Populating Values in Arrays

Steve Etter

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Morristown, TN
Posts
965
I have a new machine arriving in a couple of months where the various machine setup parameters (recipes values) are stored in multiple arrays. My best guess is that there will be about 50 to 60 initial recipes each with about 30 values that need to be entered. At the moment I am having my production people develop a spreadsheet with all these values and once the machine arrives and commissioning is mostly complete, I need to transfer these values into their appropriate array locations.

Assuming that makes sense, I'm looking for a way to intelligently transfer all these parameters without having to rely on human intervention to get them from the spreadsheet to the PLC. Does anyone have a method for this - some kind of import/export thing or maybe a reiterative routine?

My processor is a CompactLogix L43S and I have or can get any software I might need. What I don't have is a viable method (yet).

Steve
 
If you have a licensed copy of RSLinx Classic, you can write an Excel macro which will write (or read) values to and from your PLC. I do this all the time where there are numerous parameters to be written.
 
jkerekes - Interesting idea. I can see this being particularly useful for writing and re-writing multiple times to the same tags, but what about for unique array points each time? I should imagine writing something that increments re-runs itself given number of times - sort of a Do-Loop process - but I have never seen a macro like that. If you have such a thing, would you care to send me a copy?
 
You could use Archies AdvancedHMI CLX driver along with the Excel library that he link'd in this thread (you would need to know a little VB.NET):

http://www.plctalk.net/qanda/showthread.php?t=73096
Making the OPC connection via RSLinx is no problem, I have the software and have done so before. I'm hoping I can find something to let me loop through repeated points, if that makes sense. I fear the straight-forward OPC method would have me connecting to each and every point and take just as long as typing the values by hand.
 
I "borrowed" this idea from others. Not really that complicated. It does use loops to index through a whole array. I have one for prompts for example. This is a snipet of code:

For PromptIndex = 0 To 60
RowIndex = PromptIndex + 3

'Prompt_Text
DataValue = Worksheets(Sheet).Cells(RowIndex, 2)
Worksheets(Sheet).Cells(1, 11).Value = DataValue
TagName = "Prompts[" & PromptIndex & "].PromptText"
Application.StatusBar = "Writing " & DataValue & " to " & TagName
'write data thru channel
DDEPoke RSIChan, TagName, Range("K1")
 
I "borrowed" this idea from others. Not really that complicated. It does use loops to index through a whole array. I have one for prompts for example. This is a snipet of code:

For PromptIndex = 0 To 60
RowIndex = PromptIndex + 3

'Prompt_Text
DataValue = Worksheets(Sheet).Cells(RowIndex, 2)
Worksheets(Sheet).Cells(1, 11).Value = DataValue
TagName = "Prompts[" & PromptIndex & "].PromptText"
Application.StatusBar = "Writing " & DataValue & " to " & TagName
'write data thru channel
DDEPoke RSIChan, TagName, Range("K1")
Thanks for this. I'll look it over and give it a shot.
 
Let me know if you run into issues. Their a little crude, but they work OK for me. I'm updating a couple right now.
 
I appreciate that. It's going to be a while before I can do it, though. My machine is still a couple of months out so I have to rig up a test processor when I get some time.
 

Similar Topics

We have a FactoryTalk ME application that is running on a PC (not a PanelView screen). Is it possible to dynamically populate the items in a...
Replies
1
Views
1,184
Hi, I'm running FT View Studio Site Edition Network Station. I can see many things listed under the communications tab, but nothing is showing up...
Replies
1
Views
2,494
Factory talk ME My laptop hard drive went bad and I had to reinstall all the rockwell software. Now my list of applications I can open are...
Replies
3
Views
3,514
What is the quickest way to populate a Table in SQL using Factory Talk Transaction Manager(Rssql) from an array of information in a ContolLogix...
Replies
3
Views
2,693
I am reading data from an Omron PLC using CX-Server into an Excel file. The data populates 4 different columns and that data is overwritten...
Replies
5
Views
7,770
Back
Top Bottom