System Functions - Siemens SIMOTION Function Manual

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

Advertisement

Setting the communication addresses via the user program
4.1 Setting the PROFIBUS address
It is only possible to change the address at the interface when this is set to the DP slave
operating mode.
Note
After changing the configured address, it is no longer possible to route via this interface into
other devices or interfaces (see "Routing in the communication network" in the section titled
System behavior (Page 43)).
If it must still be possible to route via this interface into other devices or interfaces, the
Activating a configuration (Page 89) functionality should be used instead.
4.1.1

System functions

● _getActiveDpSlaveAddress
● _setDpSlaveAddress
● _activateDpSlaveAddress
The syntax of these system functions is described in detail in the "System Functions/Variables
Devices" List Manual (reference list) and in the online help (see index).
You specify the DP interface of the SIMOTION device via its project-wide, unique, logical,
diagnostics address. This diagnostics address is obtained, e.g. in HW Config, via the object
properties of the interface (Addresses tab).
Example for reading, setting, and activating the DP slave address
// Variable declaration
VAR
END_VAR
// Read active DP slave address
retDpSlaveAddress := _getActiveDpSlaveAddress (
IF (0 = retDpSlaveAddress.functionResult) THEN
42
This function is used to determine the active DP address (node number) of a DP interface
on a SIMOTION device.
This function is used to set a new DP address (node number) for a DP interface on a
SIMOTION device.
This function is used to activate the DP address (node number) for a DP interface on a
SIMOTION device.
// Diagnostics address of the PROFIBUS interface
logAddrDpAdapter : DINT := 1023;
// PROFIBUS address of the local slot
locDpSlaveAddress : SINT := 4;
// Variables for the return values
retDpSlaveAddress : structRetDpSlaveAddress;
locRetVal : DINT;
neededSetDpAddress : DINT := 0;
logicalAddressCommunicationAdapter := logAddrDpAdapter
// Diagnostics address of the PROFIBUS interface
);
Basic Functions for Modular Machines
Function Manual, 04/2014

Advertisement

Table of Contents
loading

Table of Contents