Read for RM Structure in Advanced Ladder
See also: Removable Media in Advanced Ladder
See also: Project Toolbox for Advanced Ladder
Topic Menu
Using Structures with Variable-Based Advanced Ladder |
All About Arrays in Variable-Based Ladder Logic |
From Cscape 9.90 SP3 and firmware 15.40 onwards, RM Structure has been supported in variable based advanced ladder editor.
Note: For Variable-Based Advanced Ladder, see: Variable Based Advanced Ladder
Structures
A structure is a complex data type defined as a set of members. Members of a structure may have various data types. A member of a structure may have dimensions or may be an instance of another structure. When a structure is defined, it may be used as other data types to declare variables.
Members of a structure may have an initial value. In that case, corresponding members of all declared variable having this structure type will be initialized with the initial value of the member.
For specifying a member of a structured variable in languages, use the following notation:
VariableName.MemberName
Restrictions
-
If a member of a structure is an instance of another structure, the nested structure must be declared BEFORE in the list.
-
User cannot declare arrays of structures.
Defining Structures
To create a new type of data structure, right-click on the program variables window and select Add Structure. Each structure is represented as a group in the window. Enter the members of the structure in its group in the same way as variables are entered in another group. New data structures are created with default name. Use right-click option "Rename' to change its name. An instance of the structure can be created within another structure if the structure is already defined.
Return to the Top: Read for RM Structure in Advanced Ladder
Read RM Structure*
*Only available in Variable-Based Advanced Ladder. See: Variable Based Advanced Ladder
Also called: Read Data File csv. This Instruction allows reading a CSV, XML and BIN file from the Removable Media interface into Structure Data.
This Instruction allows reading a CSV, XML and BIN file from the Removable Media interface into Structure Data.
-
File Name - This is the filename to read the values from the controller. This can be a constant or a Tagged registers. If this is a constant it can take up to 147 characters long that includes sub directories (i.e. "my_data\test.csv"). If the filename is stored in registers it still has a limit of 147 characters and must be terminated with a NULL (byte containing zero). File and directory names are limited to the 8.3 convention. This is 8 characters for the name and 3 characters for an extension with a period (.) separating them.
-
File Extension Type - RM Structure Read support three types of file extension - CSV, BIN and XML. From the File Extension Type drop-down list user can select required file type.
-
Destination Address - This is a Instance of Structure Data where the read data is placed. A Structure is a complex data type defined as a set of members. Members of a Structure may have various data types, but RM Structure read only support following Data members.
-
Supported Data Members: BOOL Boolean- [Data Type BOOL] - A single bit, binary value, or register/variable. Boolean points have only two possible values, 'TRUE' or 'FALSE'., BYTE Byte - [Data Type BYTE] - A string of 8 consecutive bits. A single BYTE is also the size of a single ASCII character., INT Integer - [Data Type INT] - A 16-bit signed value. Integers are used where the value of the data is expected to be in the range of -32,768 to +32,767., DINT Double Integer - [Data Type DINT] - A 32-bit signed value. Double Integers are used where the value of the data is expected to be in the range of -2,147,483,648 to +2,147,483,647., USINT Unsigned Short Integer - [Data Type USINT] - An 8-bit unsigned value. Unsigned Short Integers are used where the value of the data is expected to be in the range of 0 (zero) to 255. ,UINT Unsigned Integer - [Data Type UINT] - A 16-bit unsigned value. Unsigned Integers are used where the value of the data is expected to be in the range of -0 (zero) to 65,535. ,UDINT Unsigned Double Integer - [Data Type UDINT] - A 32-bit unsigned value. Unsigned Double Integers are used where the value of the data is expected to be in the range of 0 (zero) to 4,294,967,296., REAL REAL: Single precision floating point value - Real constant expressions must be valid number, and must include a dot ("."). If the user needs to enter a real expression having an integer value, add ".0" at the end of the number. The user can use "F" or "E" separators for specifying the exponent in case of a scientist representation. REAL is the default precision for floating points: such expressions do not need any prefix. ,LREAL The LReal is a 64-bit variable often referred to as double precision floating point or simply as a ‘double’. This feature allows Long Real data type to be configured in a program.
-
Restrictions - RM structure Read will not support Nested Structure and Arrays of Structure. Structure size should not exceed 8192 bytes.
-
Status - This is a 32-bit controller registers used to show the status [see: Removable Media in Advanced Ladder ] of the function block. The first 16-bit register is a status code, see the possible status codes . The second 16-bit register shows the number of elements successfully written.
-
Read From Start Of File - This is a 1-bit Boolean variable, Enabling this bit allows user to read data from starting of the file.
-
File Header Present - Selecting this option indicates that column header is present in file.
-
Rung Power - This function passes power once the Status returns a 0, assuming power is still applied to the function. If power is lost to the Write function before it is finished, however, the function will still complete.
Return to the Top: Read for RM Structure in Advanced Ladder