Data Transmission¶
Data Sets
All user data in the RCOM network are transmitted in so-called data sets (DSs for short). They consist of a maximum of sixteen 16 bit data words (eight 32 bit double words in case of MasterPiece).
A maximum of one data set can be transferred in each job telegram. For transmission of large amounts of data should, several jobs have to be started.
For identification, each data set has a number (“ID”) assigned, which is also transferred in the telegram.
In the PLC program, data sets can be stored in word arrays. The address of the start word must be set at input “DATA” by using the ADR operator.
For transmission, the data set number “ID”, the first of 16 words (start word at “DATA”) and the number of data words to be transferred (“LEN”) has to be specified at the connection element used for transmitting the data set.
Three options for transmission of data sets are available:
- Write data sets to slave
- Read data sets from slave
- Event polling
Write data set
The master can write a data set to the slave by reading the user data and sending them to the slave by means of a telegram. The data are stored at the specified address of the function block, e.g. in a word array. The slave confirms the reception of data in the response telegram.
Read data set
The master reads a data set from the slave by first sending a job telegram to the slave. The slave receives this telegram, reads the data from the address specified by input “DATA” and returns the data in the response telegram. The data of the response telegram are stored at the address specified at input “DATA” of the corresponding function block.
Event polling
In many applications it is required that the slave transfers data to the master, e.g. if an important event is contained in the process.
Normally, the slave is not allowed to start communication itself (master-slave structure). This means, the slave has to wait until the master reads the required data set.
The RCOM protocol provides a simple mechanism to solve this problem: Event polling.
If the slave wants to transmit data to the master, it can initiate the transmission as follows:
- The slave transfers the data set to a queue (event queue) on the CM574-RCOM Communication Module.
- The master cyclically polls all slaves consecutively to search for events in the queues. If an event is available, the addressed slave sends the data set in the response. If not, it sends the response Event queue empty.
This way, the slave can signal events to the master very easily. If no events occurred, no user data are exchanged. In this case, transmission is completed very quickly.
Since there is no correlation in time between triggering of the event (insertion in the queue) and event polling (read-out of the queue by the master), a time stamp is stored in the data set providing information regarding the time when the event occurred. Therefore, a data set can only contain a maximum of 14 data words and the last two words contain the time stamp.
The CM574-RCOM can store a maximum of 20 events in the queue. Further events are rejected with an error message.
The illustration below shows the event-driven transmission.
The slave detects an event and transfers the data set to its event queue (1.). The RCOM master polls the slave (2.) and receives the corresponding data set contained in the slaves response telegram (3.).