Page 1 of 1

Help with how to make definitions in FC

Posted: Mon Aug 22, 2016 6:11 pm
by QMESAR
Hi All,

Please help me understand the most easy way to do the following in FC,

In C I can do this

Code: Select all

#define  INITSTATE    1
#define  RUNSTATE    2
#define  ERRORSATE  3

then in some were in the code I can load this definition to a Varaible which is used to select the case of my case structure(Statemachine) 

MachineState = RUN 

Then in the case structure 
Switch (MachineState ) 
  and so on 


How can I do this definitions in FC? :D

much appreciated

Re: help with how to make definitions in FC

Posted: Mon Aug 22, 2016 6:34 pm
by kersing
In the project explorer create constants in the globals section.
constants-def.PNG
(2.67 KiB) Downloaded 1819 times
Now you can select them in the switch:
constants.PNG
(10.29 KiB) Downloaded 1819 times

Re: help with how to make definitions in FC

Posted: Mon Aug 22, 2016 6:45 pm
by QMESAR
Thank you very much Kersing this really helps me a whole lot :D
Really appreciate your help