CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

Initializing variables using expressions
https://forum.codesys.com/viewtopic.php?f=1&t=8598
Page 1 of 1

Author:  CoderDude [ Thu Feb 15, 2018 12:52 pm ]
Post subject:  Initializing variables using expressions

I want to initialize a variable using expressions, for instance

myVar : INT := 3 + x + 2*y;

It seems this can be done in CoDeSys 3.5:
https://help.codesys.com/api-content/2/ ... variables/

However this gives me compiler errors in CoDeSys 2.3. Is there some compiler option or so I could use to enable this? Or some neat workaround?

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/