| > 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.
|
|
>> 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 -
|