I'm having some trouble with the various data types. Although variables, channels and vchannels work similarly (in theory) I'm finding certain subtle differences and can't get the right type for what I want.
application:
I'm storing arrays as they come in over a network to a variable for later processing.
eg
Data.AddValue({{128,1,3,5,7}})
Data.AddValue({{129,2,4,6,8}})
Data = {{129,2,4,6,8},{128,1,3,5,7}}
then in processing loop the code looks for data with bit 7 set (data dirty bit) in first element, and clears this bit when data has been processed.
if(TestBit(Data[0][0],7)) Data[0][0] = ClearBit(Data[0][0],7) // do some processing on Data endif
The processing loop also uses the timestamp of each array, Data.Time[0], as part of the processing
Problem:
- If Data is V type, then AddValue sets the time of all previously added arrays in history to the same value, so I can't use the timestamps to process the data
- If Data is channel, then trying to change an existing value (Data[0][0]) is the same as AddValue, so adds new entry with incorrect data, instead of changing the existing data at [0][0]
- If data is variable then, again, trying to change a single element Data[0][0] stuffs up the entire history
I'd like to be able to add arrays to a channel/variable, and be able to go through the history and change individual elements. Is this possible using the functions AddValue etc, or do I need to manually manipulate a standard array? I only want a history of about 100 arrays
Regards
Andrew











