beautypg.com

Simpliq – ElmoMC SimplIQ Software Manual User Manual

Page 28

background image

SimplIQ

Software Manual

The Interpreter Language

MAN-SIMSW (Ver. 1.4)

4-10

Operator Description Returns

emcy(n)

Issues an emergency message from a user program,
where n is error code (32-bit long integer) defined by a
user.

Nothing

PrgErr(N)

Returns the last program error of machine N, where N is

a value between -1 and 2. This operator can be used in an
AUTO_PERR routine to query about the recent failure. If
N = -1, the

SimplIQ

drive returns the last error code of the

machine from which this function was called. Note that it
makes no sense to call PrgErr(-1) from the interpreter.

Integer

tick

Reads the system time in internal units. This function
uses an internal timer unrelated to the system
microsecond counter (refer to the TM command section
in the

SimplIQ

Command Reference Manual). As such, the

TM command timer can be modified by CAN SYNC And
Time Stamp, while the tick function timer is not affected
by any external event.

This function is used to implement the wait statement
(

5.7.5

). The tick(x) argument is the time difference used

in the wait statement. The valid range of the argument is
[0…32,000] milliseconds, a limitation based on the
implementation of the tock function (following). An
argument greater than 32,000 will abort the tick function
with an OUT_OF_RANGE error code. To read the system
time in internal units, set the argument to 0.

Integer

tock

Returns the time difference.
If internal = tick(x), tock (internal) will return the time in
milliseconds once internal = tick(x) has been sampled.
The tock function operates in a manner similar to tdif,
but it uses an internal timer, unrelated to the system
microsecond counter.
Note:
For a time difference greater than 32 seconds, the
function tock(internal) may return an erroneous result.

Integer

The built-in function call may be a part of a single expression.

Examples:
sin(3.14/3)

AC=abs(DC)

SP=SP+sin(3.14/2)