
Section 4 General Programming
4.16
Once a condition is enabled it remains enabled until it is
DISARMed
,
the event specified has occurred or until the Micro488/EX is reset. The
ON
<
event
>
DOMACRO
and
ARM
commands are mutually exclusive. The last
command issued takes precedence.
The program which we have been using for the preceding examples,
refer to Appendix D, is a good example of event driven
MACRO
execution. It
uses the
ERROR
event to execute MACRO 4. It also uses the
COMMENT
command to print a
BELL
character (
&H07
) to the screen.
4.4.6 Defining a STARTUP MACRO
One of the major features of the Micro488/EX is the ability to define a
MACRO
which will execute at
STARTUP
(power-on). This allows the
Micro488/EX to be locally programmed and moved to a remote location for
stand-alone data collection from IEEE bus instruments.
A simple example of this
STARTUP
feature would be a test system used
to monitor the power that a device consumes after Sunday at 12:30 AM
over-night. Two instruments are used, one to measure the voltage and the
other to measure the current.
The desired output format is one in which the data could be placed into
a spreadsheet for plotting or analysis. As such, the serial terminator is
disabled and an embedded
TAB
character is placed between data fields using
COMMENT
commands. This will cause the spreadsheet to place the data in
sequential columns. The serial output terminator is set to
CR
to force the
next execution of
MACRO
1
to place data on a new row.
The defined
MACRO
s would appear as…
MACRO 1
STERM NONE
Serial Output Terminator set to none
TIME
Time Stamp
COMMENT ''
Embedded TAB character to next column
ENTER 16
Get voltage reading
COMMENT ''
Embedded TAB character to next column
STERM CR
Serial Output Terminator set to CR to next row
ENTER 12
Get current reading
ENDM
Komentarze do niniejszej Instrukcji