Chapter 3. Program Data
GFK-2950C
February 2018
55
3.10
User Defined Types (UDTs)
A UDT is a structured data type consisting of elements of other selected data types. Each top-level
UDT element can be one of the following:
Top-level UDT Element
Example
Simple data type, except STRING
INT
Another UDT, except any in which the current UDT
is nested at any level.
Note:
A UDT cannot be nested within itself.
A UDT named UDT_ABC has a top-level element whose
data type is another UDT, named UDT_2.
Array of a simple data type
LREAL array of length 8.
Array of UDTs
Note:
A UDT cannot be nested within itself.
A UDT named UDT_ABC has a top-level element that is
an array whose data type is another UDT, named
UDT_row.
3.10.1
Working with UDTs
1.
In Machine Edition, add a UDT as a node under a target in
the Project tab of the Navigator. A UDT will be saved with
the target in which it is used.
2.
Edit the UDT properties and define the elements in the UDT’s
structure.
3.
Create a variable whose data type is the UDT. By default,
the variable resides in symbolic memory. You can convert
the symbolic variable to an I/O variable by assigning it to an
I/O terminal.
4.
Use the variable in logic.
3.10.2
UDT Properties
Name:
The UDT’s name. Maximum length: 32 characters.
Description:
The user-defined description of the UDT.
Memory Type:
The type of symbolic or I/O variable memory in which a variable of this UDT resides.
Non-Discrete:
(Default) Word-oriented memory organized in groups of 16 contiguous bits.
Discrete:
Bit-oriented memory.
Notes:
You cannot nest a UDT of one memory type in a UDT of a different memory type. Changing
the memory type propagates to existing variables of this UDT only after target validation.
Is Fixed Size:
If set to True, you can increase the Size (Bytes) value to a maximum of 65,535 bytes to
create a buffer at the end of the UDT. The buffer is included in the memory allocated to every
downloaded variable of that UDT data type. Use of a buffer may allow RUN Mode store of a UDT
when the size of the UDT definition has changed. For details, refer to
If set to False (default), the Size (Bytes) value is read-only and does not include a buffer at the end of
the UDT.
Size (bytes):
(Read-only when Is Fixed Size is set to False.) The total number of bytes required to
store a structure variable of the user-defined data type (UDT).
Bytes Remaining:
(Read-only; displayed if Is Fixed Size is set to True.) The UDT's buffer size; the
number of bytes available before the actual size of the UDT reaches the value of the Size (bytes)
property.
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...