S5-95U, SINEC L2 Data Transmission Using a Standard Connection
4.5 Programming Example for Data Transmission via a Standard
Connection
This section explains the structure of the control program in the following example:
Programmable controller 1 is to receive data from programmable controller 2 and to transmit data to
programmable controller 2. Refer to section 4.1 for the description of the hardware configuration.
The control program in FB1 for receiving data is structured as illustrated below.
Is the receive mailbox enabled to receive? (Bit 7 of CBR=1?)
yes no
Waiting for data arrival
(Bit 7 of CBR=0)
Evaluation of the receive mailbox
Receive mailbox enabled to receive again (Bit 7 of CBR=1)
Jump to program section “transmit”
The control program in FB1 for transmitting data is structured as illustrated below.
Is the send mailbox enabled to transmit? (bit 7 of CBS=1?)
yes no
Data transmission (PLC transmits)
Write transmit data, data length and
address of receiver to the send mailbox
Enable send mailbox to transmit
(set bit 7 of CBS to 1)
Acknowledge last transmission
(reset transmit trigger bit )
Is there an error indication in CBS?
yes no
Transmit job still pending
(transmit trigger bit is not reset)
End
Is the transmit job running? (transmit
trigger bit =1?)
yes no
EWA 4NEB 812 6112-02
4-9