Creating and Running Algorithms 191
Chapter 6
Initializing Variables
Variable initialization can be performed during three distinct VT1422A
operations.
1. When algorithms are defined with the ALG:DEFINE command.
A declaration initialization statement is a command to the driver's
translator function and doesn't create an executable statement.
The value assigned during algorithm definition is not re-assigned
when an algorithm is run with the INIT command. Example statement:
static float my_variable = 22.95;/* tells translator to allocate space for this */
/* variable and initialize it to 22.95 */
2. Each time an algorithm executes. By placing an assignment statement
within an algorithm. This will be executed each time the algorithm is
executed. Example statement.
my_variable = 22.95;/* reset variable to 22.95 every pass */
3. When an algorithm first executes after an INIT command. By using
the global variable
First_loop
, an algorithm can distinguish the first
execution since an INIT command was sent. Example statement:
if( First_loop ) my_variable = 22.95 /* reset variable only when INIT starts alg */
Sending Data to the
CVT and FIFO
The Current Value Table (CVT) and FIFO data buffer provide communication
from an algorithm to the application program (running in the VXIbus
controller). The three algorithm functions writecvt(), writefifo(), and
writeboth() provide the means to place data into the FIFO or CVT. These
special functions may be called up to 512 times.
Writing a CVT element
The CVT provides 502 addressable elements where algorithm values can be
stored (see Figure 7-4 on page 324). To send a value to a CVT element,
execute the intrinsic Algorithm Language statement
writecvt(<expression>,<cvt_element>)
, where <
cvt_element
> can take the
value 10 through 511. The following is an example algorithm statement:
writecvt(O124, 330); /* send output channel 24's value to CVT element 330 */
Each time an algorithm writes a value to a CVT element, the previous value
in that element is overwritten.
Important!
There is a fixed relationship between channel number and CVT element
for values from channels placed in the Scan List with ROUT:SEQ:DEF.
When mixing Scan List data acquisition with algorithm data storage, be
careful not to overwrite Scan List generated values with algorithm generated
values. See “ROUTe:SEQuence:DEFine” on page 323. for controlling CVT
entries from the analog scan list.
Содержание VT1422A
Страница 2: ...This page is blank...
Страница 8: ...8 Notes...
Страница 22: ...22 Support...
Страница 57: ...Field Wiring 57 Chapter 2...
Страница 58: ...58 Field Wiring Chapter 2...
Страница 96: ...94 Programming the VT1422A VT1529A B for Remote Strain Measurement Chapter 3...
Страница 162: ...160 Programming the VT1422A for Data Acquisition and Control Chapter 4...
Страница 224: ...222 Creating and Running Algorithms Chapter 6...
Страница 419: ...VT1422A Command Reference 417 Chapter 7 Notes...
Страница 420: ...418 VT1422A Command Reference Chapter 7 Notes...
Страница 425: ...Specifications 423 Appendix A Thermocouple Type E 200 800 C SCPs VT1501 02 03A...
Страница 426: ...424 Specifications Appendix A Thermocouple Type E 200 800 C SCPs VT1508 09A...
Страница 427: ...Specifications 425 Appendix A Thermocouple Type E 0 800 C SCPs VT1501A 02A 03A...
Страница 428: ...426 Specifications Appendix A Thermocouple Type E 0 800 C SCPs VT1508A 09A...
Страница 429: ...Specifications 427 Appendix A Thermocouple Type E Extended SCPs VT1501A 02A 03A...
Страница 430: ...428 Specifications Appendix A Thermocouple Type E Extended SCPs VT1508A 09A...
Страница 431: ...Specifications 429 Appendix A Thermocouple Type J SCPs VT1501A 02A 03A...
Страница 432: ...430 Specifications Appendix A Thermocouple Type J SCPs VT1508A 09A...
Страница 433: ...Specifications 431 Appendix A Thermocouple Type K SCPs VT1501A 02A 03A...
Страница 434: ...432 Specifications Appendix A Thermocouple Type R SCPs VT1501A 02A 03A...
Страница 435: ...Specifications 433 Appendix A Thermocouple Type R SCPs VT1508A 09A...
Страница 436: ...434 Specifications Appendix A Thermocouple Type S SCPs VT1501A 02A 03A...
Страница 437: ...Specifications 435 Appendix A Thermocouple Type S SCPs VT1508A 09A...
Страница 438: ...436 Specifications Appendix A Thermocouple Type T SCPs VT1501A 02A 03A...
Страница 439: ...Specifications 437 Appendix A Thermocouple Type T SCPs VT1508A 09A...
Страница 440: ...438 Specifications Appendix A 5k Thermistor Reference SCPs VT1501A 02A 03A...
Страница 441: ...Specifications 439 Appendix A 5k Thermistor Reference SCPs VT1508A 09A...
Страница 442: ...440 Specifications Appendix A RTD Reference SCPs VT1501A 02A 03A...
Страница 443: ...Specifications 441 Appendix A RTD SCPs VT1501A 02A 03A...
Страница 444: ...442 Specifications Appendix A RTD SCPs VT1508A 09A...
Страница 445: ...Specifications 443 Appendix A 2250 Thermistor SCPs VT1501A 02A 03A...
Страница 446: ...444 Specifications Appendix A 2250 Thermistor SCPs VT1508A 09A...
Страница 447: ...Specifications 445 Appendix A 5k Thermistor SCPs VT1501A 02A 03A...
Страница 448: ...446 Specifications Appendix A 5k Thermistor SCPs VT1508A 09A...
Страница 449: ...Specifications 447 Appendix A 10k Thermistor SCPs VT1501A 02A 03A...
Страница 450: ...448 Specifications Appendix A 10k Thermistor SCPs VT1508A 09A...
Страница 454: ...452 Specifications Appendix A...
Страница 480: ...478 VT1529A B Verification Calibration Appendix C...
Страница 484: ...482 Glossary Appendix D Notes...