Write 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

Structures

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

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 in 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: Write for RM Structure in Advanced Ladder

Write RM Structure*

*Only available in Variable-Based Advanced Ladder. See: Variable Based Advanced Ladder

Also called: Write Data File

Note: This ladder block allows user to Store Structure data in CSV, BIN and XML format on an Removable Media interface.

File Name - This is the filename to write 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 write supports three types of file extension - CSV, BIN and XML. From the File Extension Type drop-down list user can select required file type.

Source Address - This is a Instance of Structure where the data to write is located. 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 write only support following Data members.

Supported Data Members: BOOLClosed Boolean- [Data Type BOOL] - A single bit, binary value, or register/variable. Boolean points have only two possible values, 'TRUE' or 'FALSE'., BYTEClosed Byte - [Data Type BYTE] - A string of 8 consecutive bits. A single BYTE is also the size of a single ASCII character., INTClosed 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., DINTClosed 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., USINTClosed 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. ,UINTClosed 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. ,UDINTClosed 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., REALClosed 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. ,LREALClosed 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 write 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 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.

Mode - This is the writing mode for the function.

  1. Create - Create a new file, error if file DOES exist

  2. Append - Add data to end of existing file, error if file does NOT exist

  3. Create / Append - Create the file if it does not exist, append if the file does exist

  4. Overwrite - If the file exists overwrite with a new file

Write Column Headers on Create - Check this box to enable Write Column Headers of this block. Column headers filled with corresponding tag name. This is available only for CSV extension type.

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: Write for RM Structure in Advanced Ladder