All the data in DAQFactory is stored in memory in the form of arrays. DAQFactory supports scalars (0 dimension arrays), 1 dimensional arrays, 2 dimensional arrays, and 3 dimensional arrays. Because most of the data DAQFactory will see has a time associated with it, the arrays in DAQFactory have the ability to have a time associated with it. The time is automatically kept with the data making the data easier to manage.
Non-time associated data is stored in simple arrays. This type of data is created in DAQFactory from the results of some calculations, or manually. A manual scalar is simply a number and is entered as such anywhere in the program. A 1 dimensional array can be entered in any expression using {} notation. For example {1,2,3,4} will make a 4 element array containing the numbers 1, 2, 3, and 4. Only numbers and commas are allowed between the {}, but these numbers can be in hex or binary format using the appropriate delimiter described a little later. To create a 2 dimensional array, you must nest the {} notation. For example, {{1,2},{3,4}} creates a 2x2 array. {1,2} are in one row, two columns, and {3,4} are in the second row, in two columns. Three dimensional arrays follow accordingly: {{{1,2},{3,4}},{{5,6},{7,8}}} This is a 2x2x2 array.
Most of the data in DAQFactory has time associated with it. This is true for fresh data coming in and is stored in a channel. The array in a channel is called a history. A singular value read from your data acquisition device such as an A to D or Counter reading is appended along with its associated time to the 1 dimension array of values and times associated with that channel called the history. The new values are always inserted at the front of the array (giving the most recent value an index of zero). If the array grows larger than the given history length, the oldest values are removed. And so DAQFactory maintains a list of the most recent values of any given channel. With this list you can do any sort of data processing you may wish! For spectral data, which comes into DAQFactory as an 1 dimensional array of values with a single time stamp, data is appended to a 2 dimensional array, much like the history of singular values. A single row of a 2 dimensional array corresponds to a spectra. Likewise, Image data, which is 2 dimensional with a single time, is appended to a 3 dimensional array, the 3rd dimension being time. A single image takes one row of the 3 dimensional array. Within DAQFactory, time always exists along the rows or first indexed dimension.
Example: Lets assume we are reading a channel once a second.
After the first read the channel would have something like:
[0] Time 3:02:10 Data: 1.293
This is a scalar value with time.
A second later it will have:
[0] Time 3:02:11 Data: 1.382
[1] Time 3:02:10 Data: 1.293
This is an one dimensional array with two rows.
And in one more second:
[0] Time 3:02:12 Data: 1.483
[1] Time 3:02:11 Data: 1.382
[2] Time 3:02:10 Data: 1.293
Note: When doing array math, if you try and perform an operation or function on two arrays of different size when arrays of the same size are required, the longer array is truncated to the size of the shorter array before the operation is performed. If you perform an operation between an array and a scalar value, the operator will be applied to all the elements of the array. For example, the expression: {5,3,2} * 2 will return: {10,6,4}, but {5,3,2} * {2,3}, will return {10,9}.
Note: Many properties that use expressions require a one dimensional value. If the result of the expression is an array, then the array is converted to a single dimensional value. If the array is one dimensional, then the most recent value is used. If the array is two or three dimensional, then the mean of the most recent row is used. It is recommended, however, that you explicitly perform this conversion in your expression using subsetting to avoid confusion.