4. Programming
Advent Instruments Inc.
END WITH
The WITH statement is a compiler shortcut simplifying access to the hardware abstraction
layer (HAL) properties. By specifying a partial property name the complete property is
accessed by typing the remainder of the full property name.
ASM
Usage:
ASM { object code statements }
The ASM statement provides a means to insert object code statements directly into the
compiler output. Normally this statement should not be used as it can result in illegal
program instructions which immediately halt the program. It can be used as a means for
inserting debugging statements or accessing low level registers within the PEU.
Built in Routines and Properties
The script compiler includes a number of pre-defined subroutines, functions, and
properties that may be accessed by AI-7280 programs. The following table describes
their operation.
Functions:
ABS: Absolute value
Usage:
NUMERIC ABS(<NUMERIC>)
Returns the absolute value of the passed numeric value.
ASC: Convert to ASCII code
Usage:
NUMERIC ASC(<STRING>,<NUMERIC>)
Returns the ASCII character code of a single character contained in the string at the position
of the passed numeric parameter. For example, ASC(“Hello”,2) returns the ASCII code for
the second character, which is “e” or 101.
CHR: Convert to character
Usage:
STRING CHR(<NUMERIC>)
Converts the numeric ASCII value into a string of one character length.
EXP: Raise to the power of 10
Usage:
NUMERIC EXP(<NUMERIC>)
Returns the result of the passed numeric value raised to the tenth power.
GETBYTE: Read byte
Usage:
NUMERIC GETBYTE(<NUMERIC>)
Return a byte value from either the local PEU's data pool or the data pool shared by all
PEUs. The passed numeric value specifies the read location as follows:
Values 0 to 1199: Byte read from local data pool.
Values 10000 to 11199: Byte read from shared data pool.
HALTUNTIL: Halt until interrupt
Usage:
NUMERIC HALTUNTIL(<NUMERIC>)
92
AI-7280 Programmers Guide - Direct Control