beautypg.com

Recommended programming style – Yaskawa SMC–4000 User Manual

Page 309

background image

299

SMC–4000 User Manual

Recommended Programming Style

The SMC controller runs an interpreted, structured text
program. The structure is not strictly enforced; the
program is a simple text file with a list of instructions.
Programs that are not well structured are more difficult
to debug and maintain. Yaskawa recommends the
following program template layout because it is suitable
for any application.

Although most of the examples in the manual are quite
short and simple, many applications require much more
elaborate programming. Feel free to include blank lines
between routines, and use the tab key to indent to make
the program more readable. Yterm compresses the
blank lines and tab characters out of the program
because the controller will not accept them. Remember
this, because if a program is uploaded from the
controller, it will have lost it’s formatting. Future
versions of Yterm will have an auto format function.

Initialization

Main Loop

Application Specific

Routine 1 of…

Fault Handling

Application Specific

Routine 2 of …