Array of struct, ST language
Array of struct, ST language
(OP)
Hi.
I try to implement an array of struct in IEC61131-3 ST language.
The C code look like this:
Code:
Struct BDD
{
Unsigned char a1;
Unsigned int a2;
Unsigned int a3;
Unsigned int a4;
}
struct BDD BDD_table[4] = {
{'X', 1, 1, 2},
{'a', 0, 100, 0},
{'a', 1, 100, 2},
{'X', 2, 5, 4}
};So:
How to declare array of struct and fill inn data in array?
Thanks!
Best Regards
Hans Pettersson
I try to implement an array of struct in IEC61131-3 ST language.
The C code look like this:
Code:
Struct BDD
{
Unsigned char a1;
Unsigned int a2;
Unsigned int a3;
Unsigned int a4;
}
struct BDD BDD_table[4] = {
{'X', 1, 1, 2},
{'a', 0, 100, 0},
{'a', 1, 100, 2},
{'X', 2, 5, 4}
};So:
How to declare array of struct and fill inn data in array?
Thanks!
Best Regards
Hans Pettersson





RE: Array of struct, ST language
What PLC is this for?
Typically in a PLC you would need to create your own arrays using Data blocks.
RE: Array of struct, ST language
Thanks!
RE: Array of struct, ST language
htt
Francis
www.controldraw.co.uk
RE: Array of struct, ST language
I did success to implement the system on my PLC for the first time yesterday:). I have used it on microcontroller and C language only before.
- Hans