Call example
UNIT E_posmoA;
INTERFACE
// Definition of global variables for demo program
VAR_GLOBAL
myPosmoAControl : _POSMOA_control; // create "_POSMOA_control" instance
myEnable : BOOL; // enable posmoA
myHoming : BOOL; // homing posmoA
myJogPositive : BOOL; // jog positive posmoA
myJogNegative : BOOL; // jog negative posmoA
myBusy : BOOL; // coordination bit
myError : BOOL; // variable created by user for accessing
// an output variable of the function block
(1)
END_VAR
PROGRAM ExamplePosmoA; // Program of BackgroundTask
END_INTERFACE
IMPLEMENTATION
PROGRAM ExamplePosmoA // Program of BackgroundTask
VAR
// temporary array for outputs of FBs
tmpPkwOutput : ARRAY[0..7] of BYTE;
tmpPzdOutput : ARRAY[0..3] of BYTE;
END_VAR
(3)
// INSTANCE CALL of FB _POSMOA_control
myPosmoAControl ( pkwIn := myPkwIn,
pzdIn := myPzdIn,
enable := myEnable,
homing := myHoming,
jog1 := myJogNegative,
jog2 := myJogPositive,
busy := myBusy,
pkwOut := tmpPkwOutput,
pzdOut := tmpPzdOutput
);
(4)
(5)
// an output variable in the "_POSMOA_control" function block is assigned to a
// "myError" variable created by the user.
myError := myPosmoAControl.error;
(6)
Function blocks
3.6 Calling function blocks
Supplement to SIMODRIVE POSMO A Positioning Motor
Function Manual, 01/2015 39