Chapter 3. Program Data
GFK-2950C
February 2018
57
3.10.5
UDT Operational Notes
▪
By default, a UDT variable resides in symbolic memory. You can convert the symbolic variable to
an I/O variable.
▪
All UDT elements are public and, therefore, readable and writeable.
▪
Properties of elements of UDT variables:
The Input Transfer List and Output Transfer List properties are read-only and set to False.
The Retentive property is editable only for BOOLs and only if the UDT Memory Type is discrete. For
UDTs whose Memory Type is non-discrete, a BOOL variable has its Retentive property set to True
during validation.
▪
UDT variables are supported in LD, FBD, and ST blocks, as well as in Diagnostic Logic Blocks.
For additional operational notes, refer to the programmer Help.
Example
You want to set up six COMMREQ commands to send values to a series of six identical intelligent
modules that require individualized data of the same data types in the same format, specified by the
manual for the intelligent module. This data contains header information and several words of data.
You could proceed as follows:
1.
Add a UDT named COMMREQ6 and edit it to contain the data in the required data types and
sequence.
2.
Create an array of length 6, named ABC, of the COMMREQ6 data type.
3.
The array resides in symbolic memory. You can convert the symbolic variable to an I/O variable.
4.
Populate the variable. If the value of an element needs to be the same for all six COMMREQ6
elements, you can set up an ST for loop that uses a variable index to populate each element with
the same data, for example:
for i = 1 to 6 do
ABC[i].WaitFlag := 0;
end_for;
5.
Just before issuing one or more COMMREQs, use the Move to Flat instruction to
flatten
the
COMMREQ6 array or one or more of its top-level elements from a structure to a
flat
series of
contiguous registers in an area of % memory supported by COMMREQ.
6.
Issue the COMMREQs based on the % memory registers that you just populated with the Move to
Flat instruction.
Although you can populate the memory registers directly without a UDT and Move to Flat, there are
advantages when working with UDT variables:
▪
UDT variables reside in symbolic or I/O variable memory, which protects them from memory
overlaps and offers more protection against overwriting, whereas reference memory areas offer
no such protection. It is best to use reference memory just before issuing a COMMREQ.
▪
You can work with meaningful structure variable names and structure element names.
▪
You can set up loops with variable indexes to populate some of the values.
Summary of Contents for PACSystems RX7i
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451...