Implemented protocols in UNIGATE® CL with Universal Script
Deutschmann Automation GmbH & Co. KG
25
UNIGATE
®
fieldbus gateway UNIGATE
®
CL - PROFINET 2Port V. 1.6
15.8.14
10.4.3.2 Data structure
10.4.3.3 Communication sequence
The gateway always acts as the Slave with respect to the fieldbus and also acts as Slave at the
Modbus end. A data exchange is always initiated by the MODBUS-Master via the RS-interface. If
the Modbus-address (1st Byte) which is sent out by the Modbus-Master is identical with the
address set on the gateway, the gateway sends the received data (without Modbus-address and
CRC-check sum) to the fieldbus-master (look picture above). With it the gateway optionally com-
pletes as an introduction a Trigger byte and a Length byte.
The fieldbus-master detects when it has to analyse a record via the Trigger byte which is incre-
mented by the gateway at every inquiry. The number of the following Modbus-data is to be found
in the length byte.
Now the fieldbus-master has to analyse the Modbus-inquiry and it has to send back the answer
in the same format (optionally with the leading Trigger byte and Length byte) via the fieldbus to
the gateway.
The gateway then takes this answer and completes the Modbus-address and the CRC and
sends the data to the Modbus-Master via the RS-interface. With it the data exchange is com-
pleted and the gateway waits for a new inquiry from the Modbus-Master.
10.4.4
UNIGATE
®
as Modbus-ASCII Master
On request!
-> For the description see chapter 10.4.2 "UNIGATE® as MODBUS-Master"
10.5 The trigger byte
Since the data is always transferred cyclically on PROFINET, the gateway must detect when the
user wishes to send new data via the serial interface. This is normally done by the gateway com-
paring the data to be transferred via PROFINET with the old data stored internally - data
exchange on change (data exchange -> On Change). In many cases however, this cannot be
used as the criterion, e.g. whenever the same data is to be sent. For this reason, the user can set
control of transmission via a trigger byte (data exchange -> On Trigger). In this mode, the gate-
way always sends (and only then) when the trigger byte is changed.
Accordingly, the application program in the control in Normal mode cannot detect whether the
gateway has received several identical telegrams. If Trigger-Byte mode is activated, the gateway
increments the trigger byte each time a telegram has been received.
The first byte in the PROFINET input/output data buffer is used as the trigger byte if this mode is
activated.
10.6 The length byte
The user can configure whether the transmit length is also to be stored as a byte in the input/out-
put data area (Fieldbus lengthbyte -> active). In transmit direction, as many bytes as specified in
this byte are sent. On reception of a telegram the gateway enters the number of characters
received.