Application example 1 - Transferring floating-point numbers

This application example shows how a floating-point number of data type "real"(TwinCAT) or "float"(Mitsubishi) is transferred from a Beckhoff to a Mitsubishi controller and vice versa via CC-Link.

Because a floating-point variable of data type "float" or "real" occupies four bytes, we need two UINT16 PDO entries in the configuration for sending and receiving.

Application example 1 - Transferring floating-point numbers 1:
PDO entries for sending/receiving

To transfer a floating-point number, a UNION with the structure as shown in the next diagram is used.

Application example 1 - Transferring floating-point numbers 2:
UNION structure

This is instantiated in Main and linked with the applied PDOs of the terminal, once for sending and once for receiving a floating-point number.

Application example 1 - Transferring floating-point numbers 3:
Linking with PDOs

If both controllers are logged in and operational, the data exchange looks as follows:

Application example 1 - Transferring floating-point numbers 4:
Data exchange