5 downloading and uploading a program, 5 downloading and uploading a program -20 – ElmoMC SimplIQ Software Manual User Manual
Page 82
SimplIQ
Software Manual
Program Development and Execution
MAN-SIMSW (Ver. 1.4)
6-20
6.4.2
Evaluating Expressions Used in Compiler Directives
The #define, #if and #elseif directives may contain constant expressions for evaluation.
Such expressions – which may be either simple (a single number) or complex (a combination
of operations) – must be evaluated to a single number.
A valid expression can operate only with:
Numbers
Values of the #define directive.
If the expression contains the identifier of the #define directive, the identifier must have a
successfully-evaluated token_string.
The syntax of the expression of a pre-compilation directive differs from the syntax of
other expressions in that it has the following limitations:
It cannot contain global or local variables; only constant values are valid.
It cannot use any system or user functions, or system commands.
Only integer and float data types are allowed. Arrays and array members are
illegal.
An expression in a pre-compilation directive uses the same operators as other expressions in
the user program. The valid operators are:
Calculating operators:
*
/
=
-
%
Logical operators:
&& ║
Comparison operators: ==
!=
<
>
<=
>=
Bitwise operators:
&
|
<<
>>
Unary logical operators: !
Unary bitwise operators: ~
A detailed description of the operators is given in
. The data type of the
evaluation result depends on the operation and the type of operands. The result of logical,
bitwise and comparison operations is always integer. With calculating operations, if both
operands are integers, the result is integer; otherwise, the type is float.
6.5
Downloading and Uploading a Program
In this step of program development, communication between the Composer and the
SimplIQ
drive must be established.
After successfully compilation, the compiled code can be downloaded to the
SimplIQ
drive.
This step is supported by the Composer IDE. Before each download, the Composer
automatically clears the flash memory sector, which is used for saving the user program.
The serial flash performs downloads and uploads using two commands: DL and LS. Both
commands use the auxiliary LP command, which is a vector integer command. The CP
command can be used to clear the user flash area, and the CC command can be used to
checksum-verify the program, and set the program read flag.