RDC – Remote data connection
Block SymbolLicensing group: ADVANCED
Function Description
The RDC block is a special input-output block. The values are passed between two blocks with
the same number, but on different computers (or between two Simulinks or between Simulink
and the REXYGEN system). Values are passed using the UDP/IP protocol. Communication
works on all local LAN networks and on Internet links. The algorithm performs the following
operations at each step:
- If HLD=on, the block execution is terminated.
- If the period parameter is a positive number, the difference between the system timer and the time of the last packet sending is evaluated. The block execution is stopped if the difference does not exceed the period parameter. If the period parameter is zero or negative, the time difference is not checked.
- A data packet is created. The packet includes block number, the so-called invoke number (serial number of the packet) and the values u0 to u15. All values are stored in the commonly used so-called network byte order, therefore the application is computer and/or processor independent.
- The packet is sent to the specified IP address and port.
- The invoke number is increased by 1.
- It is checked whether any incoming packets have been received.
- If so, the packet validity is checked (size, id number, invoke number).
- If the data is valid, all outputs y0 to y15 are set to the values contained in the packet received.
- The fresh output is updated. In case of error, the error code is displayed by the err output.
There are 16 values transmitted in each direction periodically between two blocks with the same id number. The u(i) input of the first block is transmitted the y(i) output of the other block. Unlike the TCP/IP protocol, the UDP/IP protocol does not have any mechanism for dealing with lost or duplicate packets, so it must be handled by the algorithm itself. The invoke number is used for this purpose. This state variable is increased by 1 each time a packet is sent. The block stores also the invoke number of the last received packet. It is possible to distinguish between various events by comparing these two invoke numbers. The packets with invoke numbers lower than the invoke number of the last received packet are denied unless the difference is grater than 10. This solves the situation when one of the RDC blocks is restarted and with it its invoke number.
Note: All RDC blocks in the same application must have the same local port and the count of RDC blocks is limited to 64 for implementation reasons. If there are two applications using the RDC block running on the same machine, then each of them must use a different local port.
Examples
The constants 3 and 5 are sent from Computer1 to Computer2, where they appear at the y0
and y1 outputs of the RDC2 block. The constants are then summed and multiplied and sent
back to Computer1 via the u11 and u12 inputs of the RDC2 block. The displays connected to
the y11 and y12 outputs of the RDC1 block show the results of mathematical operations
and
. The
signal from the SG generator running on Computer2 is transmitted to the y0 output of
the RDC1 block, where it can be easily displayed.
The simplicity of the example is intentional. The goal is to demonstrate the functionality of the block, not the complexity of the system. In reality, the RDC block is used in more complex tasks, e.g. for remote tuning of the PID controller as shown below. The PID control algorithm is running on Computer1 while the tuning algorithm is executed by Computer2. See the PIDU, PIDMA and SSW blocks for more details.
This block does not propagate the signal quality. More information can be found in the 1.4 section.
Input
HLD | Hold | Bool |
u0..u15 | Signal to send to the remote RDC block | Double (F64) |
Parameter
target | Remote computer name/IP address | String |
rport | Remote port number 1288 | Word (U16) |
lport | Local port number 1288 | Word (U16) |
id | Block ID 1 32767 1 | Long (I32) |
period | Minimum communication period [s] | Double (F64) |
Output
iE | Error code | Long (I32) |
|
|
|
fresh | Elapsed time since the last received packet [s] | Double (F64) |
y0..y15 | Signal received from remote RDC block | Double (F64) |
[Previous] [Back to top] [Up] [Next]
2024 © REX Controls s.r.o., www.rexygen.com