Altinex MT101-114 Network Card User Manual


 
MULTITASKER
400-0402-003
22
SUBROUTINE COMMANDS
49. {RDS}
This command reads and displays the contents
of one or all subroutines.
Command Format: {RDSn}
n = Sub ID (n = # from 1 to 180, * for all)
Example 1: (Display one subroutine.)
Display the contents of SUB1 by sending
{RDS1} and the system will display the
subroutine number and its contents. The display
will be in the following format:
SUB001: LED*=0, LED1=1...............
OK
SUB001 = subroutine number
LED*=0, LED1=1 = stored functions
OK = done
Example 2: (Display all subroutines.)
Display all the subroutines. Send the command
{RDS*} and the display will be in the following
format:
SUB001: ON1C2, OFFC3, LED36=1.........
SUB002: ON2C2, OFF3C3, LED2=1.........
SUB005: ON3C2, OFF6C3, LED3=0.........
OK
NOTE: Empty subroutines will NOT be
displayed. If all the subroutines are
empty, the following will be displayed:
ALL SUBROUTINES ARE EMPTY
50. {WRS}
This command appends functions to a
subroutine. The subroutine contents may be
cleared using the {CLRS} command. The
command length is limited only by available
memory, but no more than 30 characters should
be sent in a single write statement.
Subroutines for front panel control most often
perform actions when a key is pressed. It is a
good programming practice to make the
subroutine number relate to the key number.
For example, Key 12 is used to perform
functions stored in subroutines 12 or 112
depending on the state the key. The control may
be passed to SUB12 if the key is pressed when
the LED is off and the control will be passed to
SUB112 if the key is pressed when the LED is
flashing.
Example:
Key # = SUB# ...........LED is OFF
= SUB#+50 .....LED is ON
= SUB#+100 ...LED is FLASHING
= SUB#+150 ...Key is Pressed & Held
Key 10= SUB10 .........LED is OFF
= SUB60 .........LED is ON
= SUB110 .......LED is FLASHING
= SUB160 .......Key is Pressed & Held
Key 10= {WRK10=10,60,110,160,0}
COMPLETE FUNCTIONS
Command Format: {WRSn=F
1
,F
2
,…}
Sn = Subroutine ID (n = # from 1 to 180)
F
1
,F
2
= Functions must be separated by a
comma.
Example 1:
Program SUB1 with the following functions:
ON1C3, ON2C3, and LED1=1. Send the
following command :
{WRS1=ON1C3, ON2C3, LED1=1}
Add more functions such as ON3C3 and ON4C3
to the subroutine. Each write statement is
appended to the functions that are already
stored in the subroutine. Therefore, to add the
functions ON3C3 and ON4C3, it is only
necessary to send the following command:
{WRS1=ON3C3, ON4C3}