
Leuze electronic GmbH + Co. KG
MA 238
i
42
11
Modes
11.1 Functionality of the data exchange
The fieldbus gateway has two different modes that can be selected via the PLC:
• Transparent mode (standard setting)
In Transparent mode, all data is sent 1:1 and directly by the serial end device to the PLC. It is not
necessary to use status and control bits here. However, only data bytes possible for one transmis
-
sion cycle are transmitted - all others are lost.
The distance between two successive telegrams (without frame) must be more than 20ms, since
there is otherwise no clear separation between them.
ASCII characters are typically expected as data content; under certain circumstances, the MA there
-
fore detects different control characters as invalid characters in the data range and truncates them.
At 00
h
in the data range, the MA cuts the telegram off because unnecessary bytes are also filled with
00
h
.
• Collective Mode
In Collective mode, the data of the serial end device is stored temporarily in the fieldbus gateway by
toggling the CTB bit and is not sent to the PLC in blocks until prompted to do so by the PLC.
On the PLC, a status bit (DEX) then signals that new data is ready for retrieval. This data is then read
out from the fieldbus gateway in blocks (toggle bit).
In order to distinguish between the individual telegrams on the PLC, in Collective mode the serial
frame is sent to the PLC in addition to the data.
The size of the buffer is 1 kByte.
11.1.1 Reading slave data in Collective mode (gateway -> PLC)
If the Leuze device transmits data to the fieldbus gateway, the data is stored temporarily in a buffer. The
PLC is signaled via the "DEX" bit that data is ready for retrieval in the memory. Data is not automatically
transmitted.
If no further user data is present in the MA 238
i
("DEX" bit = "0"), the "R-ACK" bit must be toggled once as
read confirmation to release data transmission for the next read cycle.
If the buffer still contains more data ("DEX bit = 1), the next remaining user data present in the buffer is
transmitted by toggling the "R
-
ACK" control bit. This process is to be repeated until the "DEX" bit returns
to "0"; all data has then been removed from the buffer. "R
-
ACK" must be toggled here again once more as
a terminating read confirmation in order to release data transmission for the next read cycle.
Used status and control bits:
• DLC
• BLR
• DEX
• R-ACK
11.1.2 Writing slave data in Collective mode (PLC -> gateway)
Writing in blocks
The data sent by the master to the slave is first collected in a "transmit buffer" by setting the "CTB" bit
(Copy to transmit buffer). Please observe that data provided is transmitted directly by toggling the bit.
NOTE
In Collective mode, the CTB and SFB bits are needed for communication handling via the buffer.
Telegrams that can also be completely transmitted in one cycle in Collective mode (including
data frame) go directly through. If PLC data is provided and transferred without a state change
of the CTB bit, it goes directly to the RS 232 interface with the set telegram data length. Incom
-
plete (incl. data frame) or faulty telegrams can cause error messages in the connected device!
Combination with the Command mode is possible.
Data exchange in blocks must be programmed on the PLC.