Specifications

Defining C Language Algorithms
This section is an overview of how to write and download C algorithms into the
VT1419A’s memory. The assumption is that the user has some programming
experience in C, but, since the VT1419A’s version of C is limited, just about any
experience with a programming language will suffice. See Chapter 4 for a
complete description of the VT1419A’s C language and functionality.
Arithmetic Operators: add +, subtract -, multiply *, divide /
Assignment Operator: =
Comparison Functions: less than <, less than or equal <=, greater than >,
greater than or equal >=, equal to ==, not equal to !=
Boolean Functions: and && or ||, not !
Variables: scalars of type static float, and single dimensioned arrays of
type static float limited to 1024 elements.
Constants:
32-bit decimal integer; Dddd... where D and d are decimal digits but D is not
zero. No decimal point or exponent specified.
32-bit octal integer; 0oo... where 0 is a leading zero and o is an octal digit. No
decimal point or exponent specified.
32-bit hexadecimal integer; 0Xhhh... or 0xhhh... where h is a hex digit.
32-bit floating point; ddd., ddd.ddd, ddde±dd, dddE±dd, ddd.dddedd,or
ddd.dddEdd where d is a decimal digit.
Flow Control: conditional construct if(){ } else { }
Intrinsic Functions:
Return the absolute value; abs(<expr>)
Return minimum; min(<expr1>,<expr2>)
Return maximum; max(<expr1>,<expr2>)
User defined function; <user_name>(<expr>)
Write value to CVT element; writecvt(<expr>,<expr>)
Write value to FIFO buffer; writefifo(<expr>)
Write value to both CVT and FIFO; writeboth(<expr>,<expr>)
Global Variable
Definition
Global variables are necessary when communicating information from one
algorithm to another. Globals are initialized to 0 unless specifically assigned a
value at define time. The initial value is only valid at the time of definition. That is,
globals remain around and may be altered by other SCPI commands or algorithms.
Globals are removed only by power-ON or *RST. The following string output is
valid for strings of 256 characters or less.
ALG:DEF ‘globals’,’static float output_max = 1, coefficients[ 10 ];
If the global definition exceeds 256 characters, it will be necessary to download an
indefinite block header, the definitions, and terminate it with a LF/EOI sequence:
ALG:DEF ‘globals’,#0static float output_max = 1, ..... LF/EOI
The LF/EOI sequence is part of the I/O and Instrument Manager in Agilent VEE.
The VT1419A I/O device must be edited for direct I/O with EOI purposely selected
to be sent with the EOL terminator.
Programming the VT1419A Multifunction
Plus
Defining C Language Algorithms
Chapter 3 73
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com