Are enumerations, structures and arrays of structures supported in the Trio IEC61131-3 code?
We have ability to
create structures, that will contain other structures and also arrays or
standard variables:
In the example above
two structures have been created and second one contain variable of datatype of
the first structure.
The Implementation
of IEC also supports arrays of structures. Here is an example of
addressing the first element of the first array in ArrayOfStruct variable.
We also can create
enumerated type of variable:
In example above
StateMachine1 variable has been created with type of StateMachine enum.
And this enumerated
variable has defined values of Idle, Homing, Active and Error.
The ST code is
showing how to use this variable in Case statement as Machine State.
The only difference
from other implementations of IEC61131 is that values ( idle, home,
active, error) do not have numerical representation, and they need to be
addressed as in the example code.
Related Articles
Moving CAM CSV/Text File to TABLE or VR's location
The example attached is a Trio basic program that will extract the numerical values of each text file line and move the values into a TABLE or VR array. The program moves the data from the controllers on board memory but can be adjusted to move data ...
Setting up Profinet connection with Trio Controllers
Requirement Minimum firmware version of 2.0319. Supporting Documents See the attached zipped file (dist.zip) for the following supporting files: Application Note AN-449 TRIO Controllers with Profinet Motion Perfect project sample GSD file: ...
Trio Scara Motor & Drive Sizes
Trio Scara Motor & Drive Sizes Drop Files to Attach
AN-389 VRSTRING 16 bits TrioBASIC Function
VRSTRING combines the contents of an array of VR() variables so that they can be printed as a text string or used as part of a STRING variable. This document explains with an example code.
Reading DX4 Fault Code Displayed On Front Of Drive
The code below will move the error number displayed on the 8 segment display into a declared variable for use in other programs. 'This example is for Axis 0 error number reading ' 'CO_READ_AXIS(axis_number, index, subindex ,type [,vr_number]) 'CoE ...