I'm very new to Structured Text and dealing with user-defined data types. I've looked online and on the codesys manual, and from what i've read, it seems like this should work:
Thanks, This helps a lot
Also I should note that I was declaring the TYPE and STRUCT in the ST code, but realized I was supposed to add it in the Data Types Tab
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm very new to Structured Text and dealing with user-defined data types. I've looked online and on the codesys manual, and from what i've read, it seems like this should work:
TYPE HistoryArr :
STRUCT
BaseRequested:REAL;
BaseActual:REAL;
AngleRequested:REAL;
AngleActual:REAL;
DateAndTime:DT;
END_STRUCT
END_TYPE
Codesys wants me to declare HistoryArr.. What type would I declare this as? eg. WORD, INT, etc
in your POU you say :
VAR
history array[1..10] of Historyarr;
END_VAR
in the ST you write for example
history[1].anglerequested :=setangle;
it works the same as when you say array of INT but now the whole structure can be used.
Related
Talk.ru: 1
Thanks, This helps a lot
Also I should note that I was declaring the TYPE and STRUCT in the ST code, but realized I was supposed to add it in the Data Types Tab