<9. Advanced Engineering >
● Examples on Use of User Data Types
Described below are some examples where definition of a user data type simplifies
programming of the application.
- Buffer for storing timestamp data and REAL-type data
Example: To store REAL-type data of an FCN-500 or FCN-RTU together with
timestamp
Define a structured data type of STRING-type and REAL-type data to be used as
data buffer.
Get the FCN-500’s or FCN-RTU’s clock time as STRING-type data using
PAS_GETTIME, and store it in STRING data. Store the REAL-type value inREAL
data.
In this way, REAL-type data can be stored with FCN-500’s or FCN-RTU’s clock
time (timestamp) in one variable.
- Data type used for inter-FCN/FCJ communication
Example: To send 100 CDATA_REAL type data using inter-FCN/FCJ
communication
As described in Section 9.1.5, “Inter-FCN/FCJ Communication Concept,”
consolidating data before transmission helps to increase efficiency of inter-
FCN/FCJ communication.
In this example, if one data is sent each time, 10 data communication function
blocks are required. Defining an array data type of 100 CData_REAL type data,
however, enables the same data to be sent/received using one variable, thus
increasing the efficiency of inter-FCN/FCJ communication.
● System-defined Array Types
The figure below shows system-defined array data types available in Logic
Designer.
When programming an application, if the required number of array elements
matches one of the system-defined array data types, it can be used without the
need to define a new user data type.