Advent Instruments Inc.
1. Getting Started
The vast majority of the properties are of a numeric data type. This means that only
numbers can be written, or read from that property. However, some of the properties are
string types. This means that ASCII character strings may be written, or read from them.
Since all aspects of the AI-7280 are determined by the HAL property values, controlling
the AI-7280 is reduced to simply reading and writing to the various properties.
There are two ways in which the property values can be manipulated. They are:
•
Commands received from the RS-232 serial port, or USB port, or
•
Statements executed by the program execution units.
The Command Processor block, shown in the previous figure, is responsible for
interpreting characters received from either the RS-232 or USB ports. It simply waits for
complete command strings to arrive from the controlling device, and then processes the
command. It will either execute the desired command, or if a syntax error is detected,
return an error message. The command processor operates in a strict master slave
relationship with the controlling device. It acts as the slave and returns data only in
response to a command.
The two commands used to access the HAL properties are set and get commands. The
set command writes a value into any HAL property, while the get command returns the
value stored in the HAL property.
In addition to set and get are other commands used to control the program execution
units. The AI-7280 contains a number of virtual processors that can be programmed for a
wide variety of tasks. These are the program execution units shown in the previous
figure. The program execution units allow the AI-7280 to operate in a semi-autonomous
manner. Programs running on the AI-7280 can perform various low-level timing critical
tasks, while the PC (or other controlling device) performs the supervisory tasks. These
programs may be stored in the AI-7280's non-volatile flash memory, or downloaded into
the volatile RAM.
To aid in writing AI-7280 programs, the TRsSim software provides a simplified high-
level language compiler. This software converts high-level language statements into
object code executed by the AI-7280. An example of such a program is as follows:
Loop
If TelInt.HookDetect = 1 Then
Exit Loop
End If
End Loop
Let ToneA.Freq = 440
Let ToneB.Freq = 350
Let ToneA.Level = 0.500
Let ToneB.Level = 0.500
Let ToneA.Enable = 1
Let ToneA.Enable = 1
The above program waits until a connected telephone device goes off-hook. Once this
occurs, it enables tone generators A and B to produce the standard North American dial
tone (440 & 350 Hz) at a level of 0.5 Vrms (open circuit).
This program can be compiled by the TRsSim software and stored in the AI-7280's flash
memory. When needed, the PC (or other controlling device), can simply execute this
program with one of the AI-7280's program execution units.
AI-7280 Programmers Guide - Direct Control
3