Main loop – Yaskawa SMC–4000 User Manual

Page 311

Advertising
background image

301

SMC–4000 User Manual

Main Loop

The main loop serves as the control center for all general machine logic. This is typically a small part of
the overall program. It is more efficient to include mode-specific logic in lower level routines. This type
of logic would include anything that only has any importance while a certain mode is activated. This
allows for a faster execution time of the main loop logic, and easier code debugging. The SMC runs an
interpreter, which means that the text code of the program is always being translated to machine language
command by command. Minimizing the amount of code the controller must execute increases efficiency.

The following is an example of a small main loop:

#MAIN

JS #HOME,((@IN[4]=1)&(homed=0))

Index=(_TI&BitMask)/BitMaskO // 500-1 determine (by input) what Station to locate

JS #ROTARY,(Index<=9) & (Index<>OldIndex) & (homed=TRUE)

JP #MAIN

Notice that the labels listed here show the modes of operation.

Advertising