Hi,
I'm curious as to why the CR1000 compiler treats For-To-Next loop with the DataTable Sub as a conditional statement and refuses to compile. For example,
///
DataTable (MyDataTable,1,-1)
Sample (1,batt_volt,FP2)
For i = 1 To 10
Sample (1,MyArrayOfDataType1(i),FP2)
Sample (1,MyArrayOfDataType2(i),FP2)
Sample (1,MyArrayOfDataType3(i),FP2)
Next i
EndTable
///
generates error upon compiling: "Sample cannot be used within a conditional statement".
Using sample in this way would be elegant for generating descriptive field names and scaling data table sizes.
Cheers,
Jonathan
There are some rigid rules enforced on data tables. These rules are needed since the datalogger needs to partition memory at compile time to handle final storage.
You will notice that all of the output processing instructions have a repetition parameter to preclude the need for a loop.