Specifications

Accessing the VT1419A’s Resources
This section describes how an algorithm accesses hardware and software resources
provided by the VT1419A. The following is a list of these resources:
·
I/O channels.
·
Global variables defined before the algorithm is defined.
·
The value ALG_NUM which the VT1419A makes available to the
algorithm. ALG_NUM = 1 for ALG1, 2 for ALG2, etc.
·
User defined functions defined with the ALG:FUNC:DEF command.
·
The Current Value Table (CVT) and the data FIFO buffer (FIFO) to output
algorithm data to an application program.
·
VXIbus Interrupts.
The Algorithm Language and Environment
Accessing the VT1419A’s Resources
Chapter 4 109
Figure 4-1: Source Listing of Function main()
/* GLOBALS you define with ALG:DEF GLOBALS... go here */
/* global variable First_loop equals 1 until all algorithms called */
static float First_loop; /* global value set to 1 at each INIT */
/**************************** function main()
****************************/
/*The VT1419A driver
creates main() at INIT time. This example shows a main created
after 2 algorithms have been defined. */
main()
{
/********* declaration of variables local to main() ********/
static float State_1, Ratio_1, Count_1; /* created if alg1 defined
*/
static float State_2, Ratio_2, Count_2; /* created if alg2 defined
*/
/********* this section created if ALG1 is defined ********/
Count_1 = Count_1 - 1; /* Count_1 used for ALG:SCAN:RATIO
*/
if (Count_1 <= 0) { /* test for ratio met (<=0 means
execute)*/
Count_1 = Ratio_1; /* Count_1 = ALG:SCAN:RATIO setting
*/
if (State_1) alg1(); /* if ALG:STATE ALG1,ON, call alg1
*/
}
/********* this section created if ALG2 is defined ********/
Count_2 = Count_2 - 1; /* Count_2 used for ALG:SCAN:RATIO
*/
if (Count_2 <= 0) { /* test for ratio met (<=0 means
execute)*/
Count_2 = Ratio_2; /* Count_2 = ALG:SCAN:RATIO setting
*/
if (State_2) alg2(); /* if ALG:STATE ALG2,ON, call alg2
*/
}
First_loop = 0; /* reset First_loop after last alg has been called
*/
}
/* ************************ end function main() *************************/
Your algorithms go here
Begin algorithm “shells”
(built by VT1419A’s driver)
End main() function
Begin main() function
(built by VT1419A’s driver)
Global variables areaGlobal variables area
First_loop declared by
VT1419A’s driver
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com