Siemens SIMOTION Function Manual page 63

Motion control basic functions for modular machines
Hide thumbs Also See for SIMOTION:
Table of Contents

Advertisement

1. Call the following parameters to start the system function:
2. Check the return value.
3. For the state query and to check whether the system function has been completed, call
4. Check the return value:
The example program below shows the asynchronous call of the _activateDpSlave function
in the BackgroundTask.
Example program for the asynchronous call for the _activateDpSlave function
INTERFACE
END_INTERFACE
IMPLEMENTATION
PROGRAM backGround // Assigned to the BackgroundTask
Basic Functions for Modular Machines
Function Manual, 04/2014
5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO
– reqActDeactGetStateMode := REQUEST_TRUE
– nextCommand := IMMEDIATELY
– The return values 16#0000_0001, 16#0000_0002, 16#0000_0005, and 16#0000_0006
indicate that the function has been completed without errors.
– The return value 16#0000_7001 indicates that the function has been started
successfully, but has not yet been completed.
– A return value < 0 indicates that the function has been terminated with errors. You can
program error routines, depending on the return value.
these again, but with the following parameters:
– reqActDeactGetStateMode := REQUEST_FALSE
– nextCommand := IMMEDIATELY
– Return value 16#0000_7002 indicates that the function is still running.
Repeat step 3.
– A return value < 0 indicates that the function has been terminated with errors. You can
program error routines, depending on the return value.
– The return values 16#0000_0001, 6#0000_0002, 16#0000_0005, and 16#0000_0006
indicate that the function has been completed without errors.
PROGRAM backGround;
VAR_GLOBAL
bgrRequestActivate : DINT := 0;
bgrResultActivate
bgrLogAddrDpSlave
bgrReqActDeactMode : enumReqActDeactGetStateMode := REQUEST_TRUE;
bgrDpAlarmMode
bgrNextCommand
bgrTimeToWait
END_VAR
VAR
retVal : DINT;
END_VAR
// ... Further instructions
Activating and deactivating components and technology objects
: DINT := 0;
: DINT := 16#FFFF_FFFF;
: enumDeviceDpAlarmMode := SET_DP_ALARM;
: enumNextCommandMode := IMMEDIATELY;
: UDINT := 30; // 30 seconds
63

Advertisement

Table of Contents
loading

Table of Contents