Creating and Running Algorithms 183
Chapter 6
Arithmetic Operators:
add
+
, subtract
-
, multiply
*
, divide
/
Note:
See “Calling User Defined Functions” on page 193.
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 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>)
Example Language
Usage
Here are examples of some Algorithm Language elements assembled to
show them used in context. Later sections will explain any unfamiliar
elements seen here:
Example 1;
/*** get input from channel 8, calculate output, check limits, output to ch 16 & 17 ***/
static float output_max = .020;
/* 20 mA max output */
static float output_min = .004;
/* 4 mA min output */
static float input_val, output_val;
/* intermediate I/O vars */
static float remote_input_val;
/* I/O var for remote channel*/
input_ val = I108;
/* get value from input buffer channel 8*/
remote_input_ val = I14001;
/* get value from input buffer channel 4001*/
output_val = 12.5 * input_val;
/* calculate desired output */
if ( output_val > output_max )
/* check output greater than limit */
output_val = output_max;
/* if so, output max limit */
else if( output_val < output_min)
/* check output less than limit */
output_val = output_min;
/* if so, output min limit */
O116 = output_val / 2;
/* split output_val between two SCP */
O117 = output_val / 2;
/* channels to get up to 20 mA max */
writecvt(remote_input_val,501);
/* remote chan val to CVT element 501 */
Содержание 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...