beautypg.com

Yaskawa LEGEND-MC User Manual

Page 10

background image

LEGEND-MC User’s Manual

7

Application Programming ..................................................................................................281

Introduction ....................................................................................................................281
Program Format .............................................................................................................281
Special Labels ...............................................................................................................282
Executing Programs - Multitasking ................................................................................283
Debugging Programs .....................................................................................................284

Event Triggers & Trippoints ..............................................................................284
LEGEND-MC Event Triggers ............................................................................285
Event Trigger Examples: ..................................................................................286
Conditional Jumps ............................................................................................289
Multiple Conditional Statements .......................................................................291
If, Else, and Endif ..............................................................................................293
Command Format - IF, ELSE and ENDIF ........................................................294
Subroutines .......................................................................................................295
Stack Manipulation ...........................................................................................296
Auto Start Routine ............................................................................................296
Automatic Subroutines for Monitoring Conditions .............................................296

Mathematical and Functional Expressions ....................................................................300
Variables ........................................................................................................................302

Programmable Variables ..................................................................................302
Internal Variables & Keywords ..........................................................................303

Arrays ............................................................................................................................306

Defining Arrays .................................................................................................306
Assignment of Array Entries .............................................................................306
Automatic Data Capture into Arrays .................................................................307

8

Input and Output of Data ...................................................................................................311

Sending Messages ........................................................................................................311

Input of Data .....................................................................................................312
Formatting Data ................................................................................................313
User Units .........................................................................................................315

9

Programmable I/O ...............................................................................................................317

Digital Outputs ...............................................................................................................317
Digital Inputs ..................................................................................................................318

10 Example Applications ........................................................................................................319

Instruction Set Examples ...............................................................................................319

Special Labels ..................................................................................................334
Wire Cutter ........................................................................................................338
Speed Control by Joystick ................................................................................339
Position Control by Joystick ..............................................................................340
Backlash Compensation by Dual-Loop .............................................................341

11 Troubleshooting .................................................................................................................343

Overview ........................................................................................................................343
Installation ......................................................................................................................343
Stability ..........................................................................................................................343
Operation .......................................................................................................................344

12 Index ....................................................................................................................................345