Specifications
The result of a comparison operation is a boolean value. It is still a type float, but
its value is either 0 (zero), if false, or 1 (one), if true. Any variable may be tested
with the if statement. A value of zero tests false, if any other value it tests true. For
example:
/* if my_var is other than 0, increment count_var */
if(my_var) count_var=count_var+1;
Intrinsic Functions
and Statements
The following functions and statements are provided in the VT1419A’s Algorithm
Language:
Functions:
abs(expression) return absolute value of expression
max(expression1,expression2) return largest of the two expressions
min(expression1,expression2) return smallest of the two expressions
Statements:
interrupt() sets VXI interrupt
writeboth(expression,cvt_loc) write expression result to FIFO
and CVT element specified.
writecvt(expression,cvt_loc) write expression result to CVT
element specified.
writefifo(expression) write expression result to FIFO.
Program Flow
Control
Program flow control is limited to the conditional execution construct using if and
else and return. Looping inside an algorithm function is not supported. The only
“loop” is provided by repeatedly triggering the VT1419A. Each trigger event
(either external or internal Trigger Timer) executes the main() function which calls
each defined and enabled algorithm function. There is no
goto statement.
Conditional Constructs
The VT1419A Algorithm Language provides the if-else construct in the following
general form:
if (expression) statement1 else statement2
If expression evaluates to non-zero statement1 is executed. If expression evaluates
to zero, statement2 is executed. The else clause with its associated statement2 is
optional. Statement1 and/or statement2 can be compound statement. That is
{statement; statement; statement; …}.
Exiting the Algorithm
The return statement allows terminating algorithm execution before reaching the
end by returning control to the main() function. The return statement can appear
anywhere in an algorithm. A return statement is not required to end an algorithm.
The translator treats the end of an algorithm as an implied return.
The Algorithm Language and Environment
Algorithm Language Reference
124 Chapter 4
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com










