4. Programming
Advent Instruments Inc.
Program Development
The AI-7280 PEUs are very simple virtualized processors. They execute code that
consists of only printable ASCII characters. The ASCII strings representing the
programs are either downloaded into the AI-7280's RAM or stored in its flash memory.
While it is possible to manually create the executing code, an easier approach is to use a
compiler that translates higher level statements into the low level code.
The TRsSim software supports the capabilities to compile high level scripting statements
into the object code used by the AI-7280. While this software is primarily meant to
provide a high level graphical user interface for control, it also includes a development
environment for creating programs.
Once a program is compiled into object code by the TRsSim software, the object code
can be used in a number of ways including:
•
TRsSim can download the object code to the AI-7280's RAM and execute the
program.
•
TRsSim can store the object code into the AI-7280's non-volatile flash memory.
This allows future execution of the program by simply sending an appropriate
command.
•
The object code can be downloaded into the AI-7280's RAM by using the
provided Win32 DLL.
•
The object code can be downloaded into the AI-7280's RAM manually by
sending the appropriate 'PC', 'PL', and 'PA' commands.
The following section provides an example of creating a program for the AI-7280 by
using the TRsSim software.
Note: An older PC software application called A.I.WorkBench can also be used to
compile high level scripting statements into object code for the AI-7280. This software
was designed to operate with the older and less capable AI-80; however, it also supports
the AI-7280 via an RS-232 connection (USB is not supported). The A.I.WorkBench
provides the same basic capability as the TRsSim software to compile, download, and
execute programs. However it lacks support for some of the advanced features unique to
the AI-7280 that do not exist on the older AI-80 product.
4.2 Programming Example
The basic concepts in creating a program for the AI-7280 are explored in this section and
the steps needed to create a program using the TRsSim software are described in a
tutorial fashion. It is assumed that the version of TRsSim running on the PC is at least
3.0.
78
AI-7280 Programmers Guide - Direct Control