Communication by PLC program

Initialization

Initialization is performed prior to the first transmission/reception. The module is thereby parameterized with the data from the corresponding Settings object.

Procedure:

1. Set "Init request" to 1
The module confirms successful initialization by setting "Init accepted".
2. Reset "Init request"
The module sets "Init accepted" to 0.
The module is ready for data exchange.

Sending data

1. Write the data to be sent in the output variables Data Out [n].
2. Set the Output Length parameter in the Control word to the number of bytes to be transmitted.
3. Toggle the Transmit Request bit in the Control word.
The module acknowledges the data transmission in the Status word via the Transmit Accepted parameter.

Receiving data

If the module in the Status word toggles the Receive Request bit, there are new receive data in the process data.

1. Read the Input Length parameter from the Status word. It contains the number of bytes to be received.
The data are located in the input variable Data In [n]. The first-received data is located in Data In 0.
2. After reading the data, acknowledge this by toggling the Receive Accepted bit in the Control word.
Only after that does the module transfer new data from the receive buffer to the process data.

Prioritization

Since received data normally cannot be repeated by the transmitter, they have a higher priority in the module than data to be transmitted.
Furthermore, the priority decreases as the channel number increases. Hence, the reception of data on channel 1 has the highest priority.