Siemens SIMOTION Function Manual page 83

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

Advertisement

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:
1. Call the following parameters to start the system function:
2. Check the return value:
For the functions _activateTo and _deactivateTo note the information below.
Note
Note for versions up to and including V4.0 of the SIMOTION Kernel:
The activation or deactivation of the technology object is not yet finished on completion
without errors of the functions _activateTo or _deactivateTo.
Therefore, keep calling the _getStateOfTo (Page 85) system function until the
commandIdState component of the return value (data type EnumStateOfTo) has the value
ACTIVE or INACTIVE.
Example program for the synchronous call for the _activateTo function
INTERFACE
END_INTERFACE
IMPLEMENTATION
PROGRAM motion_1 // Assigned to a MotionTask
Basic Functions for Modular Machines
Function Manual, 04/2014
– 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.
– Return value 16#0000_0000 indicates that the function has been completed without
errors.
USEPACKAGE Cam;
PROGRAM motion_1;
VAR_GLOBAL
motion_1_RequestActivate
motion_1_ResultActivate
motion_1_ToInstance
motion_1_CommandId
END_VAR
VAR
retVal : DINT := 0;
END_VAR
// ... Further instructions
IF ( 0 <> motion_1_RequestActivate ) THEN
retVal := _activateTo (
Activating and deactivating components and technology objects
5.4 Activating and deactivating technology objects
: DINT := 0;
: DINT := 0;
: posaxis;
: CommandIdType;
TO_Instance
reqActDeactGetStateMode := REQUEST_TRUE,
commandId
:= motion_1_ToInstance,
:= motion_1_CommandId,
83

Advertisement

Table of Contents
loading

Table of Contents