Siemens SIMOTION Function Manual page 65

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:
The example program below shows the synchronous call of the _activateDpSlave function in
a MotionTask.
Example program for the synchronous call for the _activateDpSlave function
INTERFACE
END_INTERFACE
IMPLEMENTATION
PROGRAM motion_1 // Assigned to a MotionTask
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 = WHEN_COMMAND_DONE
– 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, 16#0000_0002, 16#0000_0005, and 16#0000_0006
indicate that the function has been completed without errors.
PROGRAM motion_1;
VAR_GLOBAL
motion_1_RequestActivate : DINT := 0;
motion_1_ResultActivate
motion_1_LogAddrDpSlave
END_VAR
VAR
retVal : DINT := 0;
END_VAR
// ... Further instructions
IF ( 0 <> motion_1_RequestActivate ) THEN
retVal := _activateDpSlave (
logicalAddressOfDpStation := motion_1_LogAddrDpSlave,
reqActDeactGetStateMode := REQUEST_TRUE,
dpAlarmMode := SET_DP_ALARM,
nextCommand := WHEN_COMMAND_DONE,
timeToWaitForStationAlarm := 30 // 30 seconds
(* As of SIMOTION Kernel version V4.4
Waiting time for station ramp-up *)
);
CASE retVal OF
16#0000_0001: motion_1_RequestActivate := 0;
// Node successfully activated.
16#0000_0005: motion_1_RequestActivate := 0;
// Node was already activated, no alarm.
ELSE // Troubleshooting
motion_1_RequestActivate := 0;
END_CASE;
IF ( 0 = motion_1_RequestActivate ) THEN
// Function completed.
Activating and deactivating components and technology objects
: DINT := 0;
: DINT := 16#FFFF_FFFF;
65

Advertisement

Table of Contents
loading

Table of Contents