7 application programming, Introduction, Program format – Yaskawa SMC–4000 User Manual

Page 306: Introduction program format

Advertising
background image

296

SMC–4000 User Manual

7 Application Programming

Introduction

The SMC–4000 programming language is a powerful language that allows users to customize a program
to handle their application. Complex programs can be downloaded into the SMC–4000 memory for later
execution. Utilizing the SMC–4000 to execute sophisticated programs frees the host computer for other
tasks. The host computer can still send commands to the controller any time, even while a program is
being executed.

In addition to standard motion commands, the SMC–4000 provides commands that allow the SMC–4000
to make its own decisions. These commands include conditional jumps, event triggers, and subroutines.
For example, the command JP#LOOP, N<10 causes a jump to the label #LOOP if the variable N is less
than 10.

For flexibility, the SMC–4000 provides 510 user-defined variables, arrays and arithmetic functions, i.e.;
length in a cut-to-length operation can be specified as a variable in a program and assigned by an operator.

The following sections in this chapter discuss all aspects of creating applications programs.

Program Format

An SMC–4000 program consists of several SMC–4000 instructions combined to solve a machine control
application. Action instructions, such as starting and stopping motion, are combined with Program Flow
instructions to form the complete program. Program Flow instructions evaluate real-time conditions, such
as elapsed time or motion complete, and alter program flow accordingly.

A delimiter must separate each SMC–4000 instruction in a program. Valid delimiters are the semicolon (;)
or carriage return. The semicolon is used to separate multiple instructions on a single program line. A
carriage return enters the final command on a program line.

All SMC–4000 programs must begin with a label and end with an End (EN) statement. Labels start with
the pound (#) sign followed by a maximum of seven characters. The first character must be a letter; after
that, numbers are permitted. Spaces are not permitted.

The maximum number of labels that may be defined is 126.

Valid labels

#BEGIN

#SQUARE

#X1

#BEGIN1

Invalid labels

#1Square

#123

Advertising