Start algorithms, Communicating with algorithms, Algorithms control output values – VXI VT1422A User Manual

Page 101

Advertising
background image

Programming the VT1422A for Data Acquisition and Control 99

Chapter 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

Chan

nel

3

2

Chan

nel

3

3

Chan

nel

3

4

Chan

nel

3

5

Chan

nel

3

6

Chan

nel

3

7

Chan

nel

3

8

Input Channels

Upda

te

V

a

ria

b

le

Chan

ges

Check S

c

an S

tat

us and

Updat

e S1

xx V

a

ri

abl

es

Algorithm 4

Output Channels

Chan

nel

0

Chan

nel

1

Chan

nel

2

Chan

nel

7

Chan

nel

1

6

PHASE 1 (input)

PHA

S

E

2

P

HAS

E 1A

(o

pti

ona

l)

PHASE 3 (execute algorithms)

PHASE 4 (output)

Trigger Period

Output Delay Time

Advertising
This manual is related to the following products: