Defining C Language Algorithms - VXI VT1422A User Manual

Remote channel multi-function dac module user’s and scpi programming manual
Table of Contents

Advertisement

Defining C Language Algorithms

Note for
VXIplug&play users
Chapter 4
This section is an overview of how to write and download C algorithms into
the VT1422A's memory. It is assumed that the user has some programming
experience in C, but since the VT1422A's version of C is limited, just about
any experience with a programming language will suffice. See "Creating
and Running Algorithms" on page 181 for a complete discussion of the
VT1422A's C language algorithm functionality.
Arithmetic Operators: add
Assignment Operator:
Comparison Functions: less than
greater than or equal
>=
Boolean Functions: and
Variables: scalars of type
of type
static float
Constants:
32-bit decimal integer;
Dddd...
not zero. No decimal point or exponent specified.
32-bit octal integer;
0oo...
No decimal point or exponent specified.
32-bit hexadecimal integer;
32-bit floating point;
ddd.
or
where d is a decimal digit.
ddd.dddE±dd
Flow Control: conditional construct
Intrinsic Functions:
Return the absolute value;
Return minimum;
min(
Return maximum;
max(
User defined function; <user_name>
Write value to CVT element;
Write value to FIFO buffer;
Write value to both CVT and FIFO;
While the following discussion of algorithm definition is useful for
plug&play users as regards the coding of an algorithm or global variable
definition, the method of generating an algorithm code and actually
downloading it to the VT1422A becomes much easier because of plug&play
VT1422A.exe Soft Front Panel program and hpe1422_downloadAlg(...)
plug&play driver function.
Using the SFP "Algorithm Panel," an algorithm can be created and tested
and then stored to a file. The hpe1422_downloadAlg(...) plug&play driver
function was created specifically to download algorithms from files into the
VT1422A as part of the application program.
Programming the VT1422A for Data Acquisition and Control
, subtract
, multiply
+
-
=
, less than or equal
<
, equal to
, not equal to
==
or
, not
&&
||
!
and single dimensioned arrays
static float
limited to 1024 elements.
where
and
D
d
where
is a leading zero and
0
or
0Xhhh...
0xhhh...
,
,
ddd.ddd
ddde±dd
if(){ } else { }
<expr>
abs(
)
<expr1>
<expr2>
,
)
<expr1>
<expr2>
,
)
<expr>
(
)
<expr>
writecvt(
<expr>
writefifo(
writeboth(
, divide
*
/
, greater than
<=
!=
are decimal digits but
D
is an octal digit.
o
where
is a hex digit.
h
,
,
dddE±d
ddd.ddde±dd
<expr>
,
)
)
<expr>
<expr>
,
)
125
,
>
is

Advertisement

Table of Contents
loading

Table of Contents