
Temposonics
®
R-Series
V
POWERLINK
Operation Manual
I 44 I
6.2 Setting the node ID via “Automation Studio”
The following is a description how to set the node ID of the
R-Series POWERLINK as well as the R-Series
V
POWERLINK using
“Automation Studio” by B&R (Ber Rainer Industrie-Elektronik
Ges.m.b.H.).
6.2.1 Hardware setup
In this example R-Series POWERLINK is used with node ID 32 (default
value). It also applies to R-Series
V
POWERLINK with default node
ID 1. In this example the sensor is connected to an interface module
X20IF1082-2 which is mounted to a control system X20CP3485-1.
The screenshot of the hardware setup in “Automation Studio” is
shown in Fig. 63.
6.2.2 Defined data types
To implement a state machine an enumeration type has to be defined
that contains all used states (Fig. 64 and Fig. 65).
Fig. 63: Hardware setup in “Automation Studio”
Fig. 64: Defining an enumeration type
Name
Description
STATE_SEARCH_FOR_NODE
This is the initial state in this project. In this
state, PLC tries to read the vendor ID of
controlled nodes starting from node ID 1 up to
node ID 239 (all node IDs which are supposed
to be controlled nodes. The node ID 240 is
reserved for the managing node) until it detects
a controlled node with vendor ID 0x40 (MTS
vendor ID).
STATE_SET_NODE_ID
PLC enters into this state when the operations of
STATE_SEARCH_FOR_NODE have been finished.
In this example the node ID of the first controlled
node found with vendor ID 0x40 is set to 1.
STATE_RESET_NODE
PLC enters into this state when the operations of
STATE_SET_NODE_ID have been finished. The
sensor has to be reset in order to communicate
using the new node ID. In this state a reset of
the sensor is done.
STATE_CHECK_NODE_ID
PLC enters into this state when the operations
of STATE_RESET_NODE have been finished.
The node ID of the sensor is read and stored to
a local variable.
STATE_FINISHED
PLC enters into this state when the operations
of STATE_CHECK_NODE_ID have been finished.
6.2.3 Used variables
The following local variables are used to change the node ID (Fig. 66).
Name
Description
fbSdoRead
Predefined function block (AsEPL library) to execute
read operations on POWERLINK nodes.
fbSdoWrite
Predefined function block (AsEPL library) to execute
write operations on POWERLINK nodes.
u8NodeFoundAt
Unsigned 8 bit integer to store the node ID of the
first controlled node with MTS vendor ID which has
been found.
u8NodeIdToSet
Constant unsigned 8 bit integer which contains the
node ID that shall be set.
u8NmtResetNodeCmd
Constant unsigned 8 bit integer for the command
which has to be sent to the reset SDO in order to
reset the sensor.
u32VendorID
Unsigned 32 bit integer to store the vendor ID of
the node which is currently checked in state
STATE_SEARCH_FOR_NODE.
iState
Integer variable which represents the current state of
the implemented state machine.
Fig. 65: Defined data types
Fig. 66: Screenshot of used variables
Fig. 67: Variables used