Advent Instruments Inc.
4. Programming
The HALTUNTIL function suspends program execution until one or more interrupt flags are
set. All devices have a system wide interrupt flags register in which various bits may be set
when certain conditions are detected. In addition, each executing process block in a program
has its own private interrupt flags register.
By using the HALTUNTIL function the program's operation may be synchronized to any of
the interrupt flag bits.
The function accepts a single numeric parameter. Two bit-wise AND operations are
performed between the passed value and the system wide interrupt flags register and again
with the process's interrupt flags register. The two results are then bit-wise OR together. If
the result is a non-zero value then program execution resumes and the result is returned by
the function.
The purpose of each bit in the system wide interrupt flag register is specific to the device
model. They are generally set when various signals or events are detected. By using the
HALTUNTIL function a script programs can wait for various events rather than using a
polling method.
HEX: Convert to hexadecimal character string
Usage:
STRING HEX(<NUMERIC1>, <NUMERIC2>)
Returns a string representing the hexadecimal value of the first numeric value. The second
numeric value specifies how many characters are returned by the function.
INT: Convert to integer
Usage:
NUMERIC INT(<NUMERIC>)
Returns the integer portion of the passed number. This is the largest integer value less than
the passed number. For example, Int(3.99) returns 3, Int(-3.01) returns -4.
ISTR: Convert to integer then to character string
Usage:
STRING ISTR(<NUMERIC>)
Converts a numeric value to an integer and then to a string. The largest integer value less
than the passed number is returned. For example, Istr(3.99) returns "3", Istr(-3.01) returns "-
4".
LEN: String length
Usage:
NUMERIC LEN(<STRING>)
Returns the number of characters contained in the passed character string.
LOG: Convert to base 10 logarithm
Usage:
NUMERIC LOG(<NUMERIC>)
Returns the base 10 logarithm of the numeric value.
MID: Return single character from a string
Usage:
STRING MID(<STRING>, <NUMERIC>)
Returns a string with a single character taken from the passed string. The second parameter
determines the character position to return. The valid range for the character position is
between 1 and the length of the string.
NEG: Negate value
Usage:
NUMERIC NEG(<NUMERIC>)
Returns the negative of the passed value.
NOT: Logical inversion
Usage:
NUMERIC NOT(<NUMERIC>)
AI-7280 Programmers Guide - Direct Control
93