Event trigger - multiple move with wait, Define output waveform using at, Conditional jumps – Yaskawa LEGEND-MC User Manual
Page 299

289
LEGEND-MC User’s Manual
Event Trigger - Multiple Move with Wait
Define Output Waveform Using AT
The following program causes Output 1 to be high for 10 msec and low for 40 msec. The cycle repeats
every 50 msec.
Conditional Jumps
The LEGEND-MC provides Conditional Jump (JP) and Conditional Jump to Subroutine (JS) instructions
for branching to a new program location based on a specified condition. Unlike event triggers, the
conditional jump instruction does not halt the program sequence. Instead, it tests to see if a condition is
satisfied and then branches to a new location or subroutine. (A subroutine is a group of commands
#MOVES
Label
PR 12000
Distance
SP 20000
Speed
AC 100000
Acceleration
BGX
Start Motion
AD 10000
Wait a distance of 10,000 counts
SP 5000
New Speed
AMX
Wait until motion is completed
WT 200
Wait 200 ms
PR -10000
New Position
SP 30000
New Speed
AC 150000
New Acceleration
BGX
Start Motion
EN
End
#OUTPUT
Program label
AT0
Initialize time reference
SB1
Set Output 1
#LOOP
Loop
AT 10
After 10 msec from reference,
CB1
Clear Output 1
AT -40
Wait 40 msec from reference and reset reference
SB1
Set Output 1
JP #LOOP
Loop
EN