Universal Remote User Manual

Programming the VT1422A for Data Acquisition and Control 99Chapter 4
Start Algorithms Approximately 2000 lines of user-written 'C' code can be downloaded into
the VT1422A's memory and can be split among up to 32 algorithms.
VXI Technology refers to these as algorithms because an algorithm is a
step-by-step procedure for solving some problem or accomplishing some
end. Though the documentation continues to refer to the 'C' code as
algorithms, they can be thought of in traditional terms, with each algorithm
representing a 'C' function with a main() program which calls them.
The user-written 'C' algorithms execute after all analog/digital inputs have
been stored in the Input Buffer. The 'C' code accesses the measurement data
like constants with the names of I100-I163 (for on-board channels) and
I10000-I15731 (for remote channels) representing the 32-bit real
EU-converted numbers. As seen in Figure 4-1, the algorithms have access to
both local and global variables and arrays. The I-variables are inherently
global and accessible by any algorithm. Local variables are only visible to
the particular algorithm (just like in 'C' functions). Declared global variables
can be shared by any algorithm.
Communicating with
Algorithms
The application program can read or write any local or global variable in any
algorithm by using SCPI syntax that actually identifies the variable by name,
but a more efficient means of reading data is available through the
VT1422A's FIFO and Current Value Table (CVT). As seen in Figure 4-1,
any algorithm can write any expression or constant to the FIFO/CVT. The
application can then read the FIFO/CVT to characterize what's happening
inside the VT1422A and to provide an operator view of any input/output
channel, variable, or constant.
Algorithms Control
Output Values
Output SCP's derive their channel values from O-variables that are written
by the algorithms. O100-O163 are read/write global variables that are read
after all algorithms have finished executing. The 32-bit real values are
converted to the appropriate units as defined by the SCPI configuration
commands and written to the various output SCP's by channel number.
Figure 4-2. Instrument Operation Cycle Phases
Algorithm 1
Algorithm 2
Algorithm 3
Algorithm 5
Channel 32
Channel 33
Channel 34
Channel 35
Channel 36
Channel 37
Channel 38
Input Channels
Update Variable Changes
Check Scan Status and
Update S1xx Variables
Algorithm 4
Output Channels
Channel 0
Channel 1
Channel 2
Channel 7
Channel 16
PHASE 1 (input)
PHASE 2
PHASE 1A
(optional)
PHASE 3 (execute algorithms) PHASE 4 (output)
Trigger Period
Output Delay Time