In conjunction with a CP 441 module, the RK 512 protocol allows sending data with fixed and variable target indication as well as data retrieval. Moreover, a distinction is made as to whether the connection is unilateral or bilateral, and whether the con- nection partner is a CP 441 communication module or another device such as a SIMATIC S5 device.
The bilateral connection requires the communication function BSEND to transmit data and the communication function BRCV to receive data. For the two-way con- nection, you can also see when the data has been completely received by evaluating the parameter NDR at BRCV. With parameter EN_R you can prevent overwriting of data that has not yet been processed.
The unilateral connection requires no communication function in the user pro- gram of the receiving CPU. However, you can then not recognize when a data trans- fer is taking place in the receiving CPU and also not prevent overwriting of data that has not yet been processed. In the unilateral connection, data transmission takes place even in STOP mode of the partner CPU. The length of the consistently trans- ferred data depends on the partner CPU (at BSEND) or the CPU with the smaller length (for PUT and GET). Data consistency is 16 bytes for the CPU 412/413 and 32 bytes for the CPU 414/416/417.
Sending data to a CP 441 module with fixed destination (bilateral)
In the sending CPU, you call the function BSEND for each connection. You specify the data source at the SD_1 parameter. When you address a data area with an ANY pointer, the length specified in the ANY pointer is irrelevant: The number of bytes transferred is specified in the LEN parameter. The transferrable length is limited to 4096 bytes. At parameter R_ID you enter a value between 0 and 255. The value is im- ported once during CPU startup and cannot subsequently be changed.
In the receiving CPU, you call the BRCV function for each connection. At parameter R_ID, enter the same value that you specified at the BSEND function at parameter R_ID. You specify the data destination at parameter RD_1. When you address a data area with an ANY pointer, the length in the ANY pointer specifies the maximum length of the data block to be received.
Communication flag byte and communication flag bit are not evaluated.
Sending data to a CP 441 module with fixed destination (unilateral)
In the sending CPU, you call the function BSEND for each connection. You specify the data source at the SD_1 parameter. When you address a data area with an ANY pointer, the length specified in the ANY pointer is irrelevant: The number of bytes transferred is specified in the LEN parameter. Depending on the partner CPU, the transferable length is limited to 450 bytes.
At parameter R_ID, specify the destination area in the receiving CPU. The value is imported once during CPU startup and cannot subsequently be changed. The des- tination area – this is always a data block – is in a doubleword with the following structure:
Byte 1: B#16#01 = data block DB Byte 2: B#16#00 (any)
Byte 3: B#00 to B#FF = specification of the data amount in words Byte 4: B#01 to B#FF = specification of the data block number
Sending data to an external device with a fixed destination indication In the sending CPU, you call the function BSEND for each connection. You specify the data source at the SD_1 parameter. When you address a data area with an ANY pointer, the length specified in the ANY pointer is irrelevant: The number of bytes transferred is specified in the LEN parameter. The transferrable length is limited to 4096 bytes.
At parameter R_ID, specify the destination area in the receiving CPU. The value is imported once during CPU startup and cannot subsequently be changed. The des- tination area – for a SIMATIC S5 device, for example, this is a data block – is in a dou- bleword with the following structure:
Byte 1, bits 0 to 3: 16#0 = extended data block DX, 16#1 = data block DB
Byte 1, bits 4 to 7: 16#0 to 16#7 = communication flag bit, 16#F = no interprocessor communication flag
Byte 2: B#16#01 to B#16#E9 = communication flag byte (1 - 233), B#16#FF = no interprocessor communication flag
Byte 3: B#16#00 to B#16#FF = specification of the data amount in words Byte 4: B#16#03 to B#16#FF = specification of the data block number Sending data to a CP 441 module with dynamic destination indication In the sending CPU, you call the function PUT. You specify the data source at the SD parameter. When you address a data area with an ANY pointer, for the data (D), SIMATIC timers (T), and SIMATIC counters operand areas, the length specification must only be an even number (maximum 450 bytes). For the inputs (I), outputs (Q), and bit memories (M) operand areas, the maximum amount of data is 255 bytes.
You specify the destination area at the ADDR parameter. The size of the destination area must be the same as the size of the source area.
Sending data with the PUT function does not require a communication function in the user program of the receiving CPU. However, you can then not recognize when a data transfer is taking place in the receiving CPU and also not prevent overwriting of data that has not yet been processed.
Retrieving data from a CP 441 module with dynamic destination indication In the retrieving CPU, you call the function GET. At the ADDR parameter, you specify the data source (in the partner CPU). When you address a data area with an ANY pointer, for the data (D), SIMATIC timers (T), and SIMATIC counters operand areas, the length specification must only be an even number (maximum 450 bytes). For the inputs (I), outputs (Q), and bit memories (M) operand areas, the maximum amount of data is 255 bytes. You specify the destination area at the SD parameter.
The size of the destination area must be the same as the size of the source area.
Retrieving data with the GET function does not require a communication function in the user program of the sending CPU. However, you can then not recognize when
a data transfer is taking place in the sending CPU and also not prevent retrieval of data that has not yet been processed.