S5-95U, SINEC L2
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.
yes
Waiting for data arrival
(Bit 7 of CBR=0)
Jump to program section "transmit"
The control program in FB1 for transmitting data is structured as illustrated below.
yes
Data transmission (PLC transmits)
yes
Transmit job still pending
(transmit trigger bit is not reset)
EWA 4NEB 812 6112-02
Is the receive mailbox enabled to receive? (Bit 7 of CBR=1?)
Is the send mailbox enabled to transmit? (bit 7 of CBS=1?)
Is there an error indication in CBS?
Data Transmission Using a Standard Connection
Evaluation of the receive mailbox
Receive mailbox enabled to receive again (Bit 7 of CBR=1)
Is the transmit job running? (transmit
trigger bit =1?)
yes
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 )
End
no
no
no
no
4-9