USA57 Revision
1.2
79
Example #6 (Skip / Branch instruction)
/1s0gA0A1000S13e1G0R<CR>
/1s1gA0A100S03e0G0R<CR>
Two “Programs” are stored in storage locations 0 and 1, respectively, and the code in these
programs switches from one program to the other depending on the state of input #3. In the
example below, the code will cycle the motor between position A0 and A1000 if input #3 is High
and between A0 and A100 if input #3 is Low.
Stored command string 0:
/1s0gA0A1000S13e1G0R<CR>
This breaks down to:
“/”
Is the start character. Lets Accuriss know that a command string will follow.
“1”
Is the device address, (this is preset at the factory).
“s0”
Store command string that follows to storage location #0 (executed on power up).
“g”
Start loop block
“A0”
Go to Absolute position 0
“A1000” Go to Absolute position 1000.
“S13”
Skip next instruction if input # 3 is High
“e1”
Execute (Jump to) command string in storage location #1
“G0”
End of loop block (infinite loop since value is 0).
“R”
Instructs Accuriss to run the command(s) that are in the communication buffer.
“<CR>” Tells Accuriss that the command string is complete and causes the command to
be executed since an R is included in the command string.
Stored command string 1:
/1s1gA0A100S03e0G0R<CR>
This breaks down to:
“/”
Is the start character. Lets Accuriss know that a command string will follow.
“1”
Is the device address, (this is preset at the factory).
“g”
Start loop block
“A0”
Go to Absolute position 0
“A1000” Go to Absolute position 100.
“S03”
Skip next instruction if input 3 is Low
“e0”
Execute (Jump to) command string in storage location #0
“G0”
End of loop block (infinite loop since value is 0).
“R”
Instructs Accuriss to run the command(s) that are in the communication buffer.
“<CR>” Tells Accuriss that the command string is complete and causes the command to
be executed since an R is included in the command string.