Synchronous Call For The Functions _Activatedpslave And _Deactivatedpslave - Siemens SIMOTION Function Manual

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

Advertisement

Activating and deactivating components and technology objects
5.1 Activating and deactivating nodes on the PROFIBUS or PROFINET IO
Example program for the asynchronous call for the _activateDpSlave function
END_PROGRAM
END_IMPLEMENTATION
5.1.1.3

Synchronous call for the functions _activateDpSlave and _deactivateDpSlave

The synchronous call is recommended for MotionTasks.
With a synchronous call, the user program waits until the system function has been completed.
The return value directly indicates whether the function call was successful.
Proceed as follows for the synchronous call:
64
IF ( 0 <> bgrRequestActivate ) THEN
retVal := _activateDpSlave (
logicalAddressOfDpStation := bgrLogAddrDpSlave,
reqActDeactGetStateMode := bgrReqActDeactMode,
dpAlarmMode := bgrDpAlarmMode,
nextCommand := bgrNextCommand,
timeToWaitForStationAlarm := bgrTimeToWait
(* As of SIMOTION Kernel version V4.4
Waiting time for station ramp-up *)
);
CASE retVal OF
16#0000_0001: bgrRequestActivate := 0;
// Node successfully activated.
16#0000_0005: bgrRequestActivate := 0;
// Node was already activated, no alarm.
16#0000_7001: bgrReqActDeactMode := REQUEST_FALSE;
// Function started successfully
16#0000_7002: ; // Function running.
ELSE // Troubleshooting
bgrRequestActivate := 0;
END_CASE;
IF ( 0 = bgrRequestActivate ) THEN
// Function completed, prepare next call.
bgrReqActDeactMode := REQUEST_TRUE;
bgrResultActivate := retVal;
END_IF;
END_IF;
// ... Further instructions
Basic Functions for Modular Machines
Function Manual, 04/2014

Advertisement

Table of Contents
loading

Table of Contents