Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
I want to fill a structure (agenda) with values. When doing in a program and filling them works great
FUNCTION_BLOCKScheduleVAR_INPUT  Year:INT;  ariSchedule:ARRAY[0..10]OFAgenda:=(name:='name');soicanfillnameactivedayandmode.HowtofillsdtStartwithvalues,asigeterronousvalueswhenusingsdtstart.Yearso(name:='name',sdtstart.year:=2015)isnotworking,howtosolvethis?(*TYPEAgenda:STRUCT  Name:STRING(30);  sdtStart:SDT;  sdtEnd:SDT;  Activeday:ARRAY[1..7]OFBOOL;  Mode:INT;END_STRUCTEND_TYPE*)TYPESDT:STRUCT  YEAR:INT;  MONTH:INT;  DAY:INT;  WEEKDAY:INT;  HOUR:INT;  MINUTE:INT;  SECOND:INT;  MS:INT;END_STRUCTEND_TYPE(*revisionhistoryhm  18.oct.2008  originalversion*)END_VAR
I did find a work around by filling them in initialisation (i want to fill them in my library)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-04-20
Originally created by: scott_cunningham
From the CoDeSys help on array initialization:
I got this declaration line to work:
VAR  ariSchedule:ARRAY[0..10]OFT_AGENDA:=[(Name:='1st meeting',sdtStart:=(YEAR:=2016,MONTH:=1,DAY:=1)),                      (Name:='2nd meeting',sdtStart:=(YEAR:=2016,MONTH:=12,DAY:=31))];END_VAR
Hope this helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes now it is working i had to remove the [] btw.
thanks, i have been fiddling on it for 4 hours always changing the (.,;*&^%$[
and i knew the answer was short by.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to fill a structure (agenda) with values. When doing in a program and filling them works great
I did find a work around by filling them in initialisation (i want to fill them in my library)
Originally created by: scott_cunningham
From the CoDeSys help on array initialization:
I got this declaration line to work:
Hope this helps.
Yes now it is working i had to remove the [] btw.
thanks, i have been fiddling on it for 4 hours always changing the (.,;*&^%$[
and i knew the answer was short by.