Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

4 CONFIGURATION

Table 22: Attribute definitions for instance 4 of object Individual Input Data Set Transfer (73h)
Attribute ID Data set parameters Size
1 Reserved UINT[2]
2 Reserved UINT[2]
… … …
15 Reserved UINT[2]

4.1.2 FX0-GMOD Modbus TCP gateway


The following Flexi Soft gateway can be used for Modbus TCP: FX0-GMOD.

4.1.2.1 Basic configuration – assigning the device name and IP address


b Start Safety Designer and load the hardware configuration, including the Mod‐
bus® TCP gateway.
b Under Configuration, click on the FX0-GMOD to open the dialog box for the gateway
configuration.
b In the navigation area, click on Gateway configuration. The following dialog box is dis‐
played:

Figure 5: Configuration window for the Modbus® TCP gateway

b If you wish, change the device name of the gateway.


b Enter an IP address for the gateway and, if necessary, a subnet mask and an IP
address for a default gateway.
b Click on Connect to switch to online mode.
b Click on Transfer to device to transfer the configuration to the Flexi Soft system.

4.1.2.2 Configuring the Modbus® TCP interface


Properties of the Flexi Soft Modbus® TCP gateway
• Modbus® TCP with master and slave operation
• Supports the standard addressing conventions for Modbus® TCP

28 O P E R A T I N G I N S T R U C T I O N S | Flexi Soft Gateways in the Safety Designer 8018172/2018-10-22 | SICK


Subject to change without notice
CONFIGURATION 4

• Ethernet TCP/IP socket interface, polling, and auto-update function


• Data can also be read as the word data type.

PLC requirements for Modbus TCP


• The PLC must support the Modbus TCP protocol.
• The PLC must support either the commands Read Holding Registers and Write Multiple
Registers or the command Read/Write Multiple Registers.
The configuration steps in this section determine the way in which the data is transmit‐
ted to the higher-level PLC. In general, there are two different transmission types (as a
slave and as a master) for both directions, i.e., for Flexi Soft to the network and network
to Flexi Soft:
• Slave reception type – PLC requests (polling/gateway as a slave)
This receive mode allows the PLC to regularly request data by means of polling.
With this receive mode, the data is returned in the response to the data request.
The PLC requests data by accessing the receive data address of the FX0-GMOD
module with a Read Holding Registers message.
• Master receive mode – Gateway writes to tag/file (auto update, gateway as master)
If the data received by the FX0-GMOD via the backplane interface is to be sent to
the PLC, this data will be immediately written to a memory location on the PLC.
• Slave transmit mode PLC writes (gateway as slave)
In this transmission mode, the PLC sends messages to the FX0-GMOD in order to
write to the output data sets. For this purpose, the PLC writes the data to defined
addresses.
• Master transmit mode – Gateway reads from register (auto update, gateway as mas‐
ter)
In master transmit mode, the FX0-GMOD polls the PLC for the output data sets.

NOTE
The configuration is considered faulty if the IP address of the PLC is 0.0.0.0 and the
gateway is configured as master for one or both transmission directions.

Number of possible connections


The number of possible connections to the PLC depends on whether the FX0-GMOD is
operated as master or as slave. Depending on the setting, up to 32 PLCs can address
the FX0-GMOD at the same time.
Table 23: Number of possible connections
Transmission mode Maximum number of connections
Rx (to PLC): master Rx and Tx: 1
Tx (from PLC): master
Rx (to PLC): master Rx: 1
Tx (from PLC): slave Tx: 31
Rx (to PLC): slave Rx: 31
Tx (from PLC): master Tx: 1
Rx (to PLC): slave Rx and Tx: 32
Tx (from PLC): slave

Configuration
The following table describes the configuration process depending on the transmission
mode.

8018172/2018-10-22 | SICK O P E R A T I N G I N S T R U C T I O N S | Flexi Soft Gateways in the Safety Designer 29


Subject to change without notice
4 CONFIGURATION

Table 24: Configuration guideline – Gateway as master


Gateway is master
Necessary settings in the gateway configura‐ Necessary settings in the PLC program and/or
tion in the Modbus TCP configuration tool
Select Gateway writes to tag/file and/or Gateway
reads from register to configure the gateway as a –
master.
Select which data is to be written to or read

from the PLC.
Define the location in the PLC memory to Make sure that the registered addresses
which the selected data shall be written: enter entered on the gateway are available and con‐
register address(es). tain the data intended for the Flexi Soft sys‐
Example: "400001" tem.
Define the location in the PLC memory from Note: Modbus TCP communication uses Port
which the selected data shall be read: enter 502 as default.
register addresses.
Define how often this data shall be transmit‐

ted.
Determine the location from which the data
should be read and to which they should be

written in the Modbus TCP network: Enter the
IP address and device ID.

Table 25: Configuration guideline – Gateway as slave


Gateway is slave
Necessary settings in the gateway configura‐ Necessary settings in the PLC program and/or
tion in the Modbus TCP configuration tool
Select PLC requests and PLC writes in the gate‐

way configuration window.
Define which data is to be written to or read
from the gateway.
– Make sure the PLC program writes the data to
the addresses defined for the gateway (see
table 26, page 34).

NOTE
Numbering of the register addresses starts at 1, but Modbus addressing starts at 0. It
is therefore necessary to subtract 1 from the register address for correct addressing.
For example, the current system time (register 4200) is sent in the message as Modbus
start address 4199.

Master mode – FX0-GMOD reads from/writes to the PLC


Configuring the gateway as a master
b Start Safety Designer and load the hardware configuration, including the Mod‐
bus® TCP gateway.
b Under Configuration, click on the FX0-GMOD to open the dialog box for the gateway
configuration.
b In the navigation area, click on Gateway configuration. The following dialog box is dis‐
played:

30 O P E R A T I N G I N S T R U C T I O N S | Flexi Soft Gateways in the Safety Designer 8018172/2018-10-22 | SICK


Subject to change without notice
CONFIGURATION 4

Figure 6: Configuring the Modbus® TCP gateway as a master

b In the Gateway configuration dialog box, activate the Gateway writes to tag/file option for
the Flexi Soft to network direction and the Gateway reads from tag/file option for the
network to Flexi Soft direction.
b Check the boxes for the required data sets in the relevant configuration area to
select the data which is to be written to the PLC or read from it (for a description of
the data sets, see "Data transferred to the network (network input data sets)",
page 111).
b Specify the location in PLC memory bank in which the selected data is to be writ‐
ten or the location from which it is to be read. Enter addresses in the Holding regis‐
ter address input field (max. 20 characters).
b For the Flexi Soft to network transmission direction, select the Write all sets in one
tag option if all data sets are to be written to the PLC memory in a single address.
In this case, the register address defined for data set 1 is used.
b For the Flexi Soft to network transmission direction, specify how often the data is
to be transferred to the PLC:
° Select the Enable COS update (update in the event of change of state) option if
the FX0-GMOD must update the data in the PLC immediately if something in
the data sets changes.
° Select the Enable heartbeat rate option to update the selected data sets with
the set heartbeat rate.
b For the network to Flexi Soft transmission direction, specify how often the data is
to be read from the PLC.
° Enter a heartbeat rate to update the selected data sets at the specified inter‐
val.
b Specify the location from which the selected data is to be written in the Modbus®
TCP network or the location from which it is to be read. Enter the IP address and
Modbus® device ID of the PLC.
b The max. PLC update rate determines the maximum rate for transferring data sets to
or from the PLC. The setting is dependent on the processing speed of the PLC and
can be between 10 and 65,535 ms. The default setting of 40 ms is suitable for
most PLCs.

8018172/2018-10-22 | SICK O P E R A T I N G I N S T R U C T I O N S | Flexi Soft Gateways in the Safety Designer 31


Subject to change without notice
4 CONFIGURATION

NOTE
If the value entered for the max. PLC update rate is higher than the heartbeat rate set
for writing to or reading from the PLC, then the heartbeat rate is automatically
increased to this value (i.e., slowed down).

b Click on Connect to switch to online mode.


b Click on Transfer to device to transfer the settings to the Flexi Soft system.

Write to PLC

NOTE
The following limitations apply if the gateway operates as a master and writes the input
data sets to the PLC:
• The register address of the input data set (set via Flexi Soft configuration software)
must be the same as defined on the PLC.
• The variable on the PLC that is to receive the data must meet the following condi‐
tions:
° It must be in the address range 40xxxx (for Schneider Modicon PLCs).
° It must be an array of 16-bit words.
° It must be long enough to contain the defined input data set array.
• All input data sets are transmitted to the PLC in integer format (16-bit word),
whereby the first byte is placed as the least significant byte or rightmost byte of
the integer and the second byte is placed as the most significant byte or leftmost
byte of the integer.

Read from PLC

NOTE
The following limitations apply if the gateway operates as a master and reads the out‐
put data sets from the PLC:
• The register addresses of the output data sets must be the same as defined in the
PLC.
• The variables on the PLC from which the data is to be requested must meet the
following conditions:
° They must be in the address range 40xxxx (for Schneider Modicon PLCs).
° They must be an array of 16-bit words.
° They must be long enough to contain the entire output data set.
• All output data sets are transmitted from the PLC in integer format (16-bit word),
whereby the first byte must be placed as the least significant byte or rightmost
byte of the integer and the second byte placed as the most significant byte or left‐
most byte of the integer.

Slave mode – PLC requests/writes to the FX0-GMOD


With this transmission type, the FX0-GMOD works as a slave. It sends data to the PLC
on request and the PLC writes the data to the gateway.
Configuring the gateway as a slave
b Start Safety Designer and load the hardware configuration, including the Mod‐
bus® TCP gateway.
b Under Configuration, click on the FX0-GMOD to open the dialog box for the gateway
configuration.
b In the navigation area, click on Gateway configuration. The following dialog box is dis‐
played:

32 O P E R A T I N G I N S T R U C T I O N S | Flexi Soft Gateways in the Safety Designer 8018172/2018-10-22 | SICK


Subject to change without notice
CONFIGURATION 4

Figure 7: Configuring the Modbus® TCP gateway as a slave

b In the Gateway configuration dialog box, activate the PLC requests option for the Flexi
Soft to network transmission direction and the PLC writes option for the network to
Flexi Soft transmission direction.
b Check the boxes for the required data sets in the relevant configuration area to
select the data which is to be requested or written by the PLC (for a description of
the data sets, see "Data transferred to the network (network input data sets)",
page 111).
b Click on Connect to switch to online mode.
b Click on Transfer to device to transfer the settings to the Flexi Soft system.

PLC writes output data sets


The following limitations apply if the PLC writes the output data sets:
• The device ID must be "1".
• The message must be sent in word format.
• All output data sets are transmitted from the PLC in integer format (16-bit word),
whereby the first byte must be placed as the least significant byte or rightmost
byte of the integer and the second byte placed as the most significant byte or left‐
most byte of the integer.

PLC requests input data sets


The following limitations apply:
• The device ID must be "1".
• The variable in the PLC that is to receive the data must meet the following condi‐
tions:
° It must be in the address range 40xxxx (for Schneider Modicon PLCs).
° It must be an array of 16-bit words.
° It must be long enough to contain the defined input data set array(s).
• All input data sets are transmitted to the PLC in integer format (16-bit word),
whereby the first byte is placed as the least significant byte or rightmost byte of
the integer and the second byte is placed as the most significant byte or leftmost
byte of the integer.

8018172/2018-10-22 | SICK O P E R A T I N G I N S T R U C T I O N S | Flexi Soft Gateways in the Safety Designer 33


Subject to change without notice
4 CONFIGURATION

FX0-GMOD as slave – Data addressing


The following table lists the addressed for reading out the data sets.
Unit ID: 1
Table 26: Data addressing for the FX0-GMOD as slave
Address Description Access type Scope
(Base 1) [words]
1000 Request data of all activated input data sets Read 16 … 101 1)
1100 Request data of input data set 1 Read 25
1200 Request data of input data set 2 Read 16
1300 Request data of input data set 3 Read 30
1400 Request data of input data set 4 Read 30
2000 Write all activated input data sets Write 5 … 25 2)
2100 Write data of output data set 1 Write 5
2200 Write data of output data set 2 Write 5
2300 Write data of output data set 3 Write 5
2400 Write data of output data set 4 Write 5
2500 Write data of output data set 5 Write 5
1) Corresponds to all activated input data sets.
2) Must correspond to all activated output data sets. Example: If only the output data sets 1 and 2 are acti‐
vated, then 10 words (20 bytes) must be written. If all output data sets are activated, then 25 words
(50 bytes) must be written.

NOTE
• All data sets can be read or written only as a complete block. It is not possible to
read or write individual bits or bytes.
• If the control system cannot be configured in words, the data scope must be con‐
verted correspondingly.

Modbus commands and error messages


The FX0-GMOD supports the following Modbus commands and error messages:
Table 27: Modbus commands
Modbus command Value
Read Holding Registers 3
Write Multiple Registers 16 (10h)
Read/Write Multiple Registers 23 (17h)

Table 28: Modbus error messages


Modbus error Modbus error Description
number message
1 Illegal function The requested function is not supported.
2 Illegal data Undefined data address received
address
3 Illegal data value Request with illegal data values, e.g. not enough data
requested for a data set
10 The gateway path Illegal configuration, e.g. polling or setting of the digital
is not available. outputs via PLC during operation of the FX0-GMOD in
master mode

34 O P E R A T I N G I N S T R U C T I O N S | Flexi Soft Gateways in the Safety Designer 8018172/2018-10-22 | SICK


Subject to change without notice

You might also like