| Title: | BASEstar Open Multiplatform Application Framework |
| Notice: | Kit pointers: see topic 3 |
| Moderator: | VARESE::CORBETTA |
| Created: | Tue Oct 02 1990 |
| Last Modified: | Fri Jun 06 1997 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 607 |
| Total number of notes: | 1971 |
From one of our customers:
I am pulling data from an Allen Bradley PLC 5/30 in array format.
Some of these items that I'm pulling need to be updated periodically.
I've already figured how to read the entire array, but I would like to
see if someone might have a better idea for the way I will write to
them.
I don't want to write back the entire array when I write one of the
items back because some of the items might be changing based on other
activity in the area. Soooo I have two scenarios that I can use to
update these items:
1. Map over the array and write out just the mapped item - I don't
know if this writes the whole array or just the mapped item and
I would have to make a new variable (data point) for each item.
2. Create individual variables (data points) for each item in the
array and write it out as an individual.
I'm presently going to implement #2 because it is simpler but I
would like to know if there might be an easier way using arrays (or
whatever) to do this. Please include an example if you come up with
anything.
Thanks, Linda Slone
Milliken
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 573.1 | I think I would go with option 2. | BASEX::EISENBRAUN | John Eisenbraun | Mon Mar 10 1997 14:00 | 21 |
> 2. Create individual variables (data points) for each item in the
> array and write it out as an individual.
> I'm presently going to implement #2 because it is simpler but I
> would like to know if there might be an easier way using arrays (or
> whatever) to do this. Please include an example if you come up with
> anything.
I don't think 1. would work, but 2. is certainly an option. The only
other possibility I can think of is to use a pollset. Create
individual unnamed variables and put them into a pollset. If SMA_MODE
is enabled, the device server will read them as a group and the DAS
will convert the individual points into one read.
A pollset may not work, however, if the application can't tolerate any
latency in the update of the values, since the pollset items are
updated only every X seconds. Also, if the application wants to read
the values as an array and not as individual points, this solution
won't work very well either.
So, I think Linda has come up with the best solution already.
| |||||
| 573.2 | READ vs. WRITE | IMPERO::SERRA | Volumeappalla! | Mon Mar 10 1997 15:31 | 25 |
>> 1.Map over the array and write out just the mapped item - I don't
>> know if this writes the whole array or just the mapped item
The whole array is written back to the device whenever a single
mapped data point is modified.
>> 2.Create individual variables (data points) for each item in the
>> array and write it out as an individual.
This sounds better as far as writing data to the device is
concerned, but, as already pointed out by John in .1, it would
affect also the "getting data from the device" part of the job,
as you won't have a unique, array-typed couple UnNamedVariable +
DeviceDataPoint, but rather many, scalar-typed couples.
If you use individual UnNamedVariable/DeviceDataPoint couples,
which is good to WRITE single array elements to the device,
the only option you have to READ the entire array as a whole
is indeed a polling_set with SMA_MODE enabled at VMD's level.
- Beppe -
| |||||