beautypg.com

Example – Yaskawa FSP Amplifier FlexWorks User Manual

Page 41

background image

Operating the FSP Amplifier Using FlexWorks

41

4.4.2.1. Example

The following example program illustrates how arguments can be
specified by variables.
In the program, a sequence of movements is performed. The
motion characteristics of each movement are dependent on the
value of the digital inputs. For each combination of digital inputs a
different set of values are assigned to the variables that set the

motion characteristics.
The main part of the program (8 to 16) sets the profile velocity and
initiates motion. Once a pre-specified position has been passed, the
speed is reduced. Once the commanded motion has ended, a
second motion back to the origin is started. 500 ms after the

second motion has ended, the program restarts.
Most of the commands used in the main section use variables to
specify the value of the arguments. Depending on the initial state
of the inputs, the program calls (in lines 4 and 6) a different
subroutine (Label 3 or Label 4) to set the variable values.
Evaluation of Digital Inputs
1 LABEL 1
2 WAIT_INPUT 1 = 0 -1
3 WAIT_INPUT 1 = 1 -1
4 INPUT_CASE 12 4
5 CALL 3
6 INPUT_CASE 12 12
7 CALL 4
Main
8 LABEL 2
9 SET_VAR Profile_velocity Var_03
10 GO_H Var_01
11 WAIT_VAR Position_actual_value > Var_02
12 SET_VAR Profile_velocity Var_04
13 WAIT_STOP -1
14 GO_D 0 Var_05
15 DELAY 500
16 GO_TO 1
Subroutine 3
17 LABEL 3

This manual is related to the following products: