There is no specific limitation on number of members a struct may have. You may have several hundreds. You just need to take into account the overall memory for tags that is 2 MB.
A struct is a complex data type declaration that defines a physically grouped list of variables (of different data types) to be placed under one name in a block of memory, allowing the different variables to be accessed via a single declared name which returns the same address.
In Unilogic there are four types of Structs:
– Hardware Structs that serve hardware elements such as I/O and COM modules and modems
– Communication structs such as MODBUS and CANopen.
– Function Structs, such as PID.
To create a User-defined struct please follow the next steps:
Click the Struct tab on the bottom of the Operand Window.
Either click the Add Struct icon, or right-click and select Add Struct.
Name the Struct and click Save.
4. Either click the Add icon or right-click the window to add members to the Struct. You can add single operands or arrays)
To use the struct on your project, you need to declare an instance.
You can declare an instance of a Struct either as a global tag, or a local tag.
Right-click the Global Tag window, or the window of a function. Name the instance, then scroll down until you see the name of the desired Struct and select it.
Now that the Struct is declared, you can assign Alias names to the members.
You can also drill down and assign Alias names to individual members within arrays that you have included in the Struct.
Now that the Struct has been declared, it can be used in your program just like any other tag.
There is no specific limitation on number of members a struct may have. You may have several hundreds. You just need to take into account the overall memory for tags that is 2 MB.
Is there any limitation for a struct? May I know how many members can I have in one struct?