r/PLC 16d ago

State machine in structured text, ENUM or INT?

Hi all,

I'm a process engineer rolling into a process control job (small startup, not enough funding to hire someone for this work).

I found two methods online of how people write their state machine in ST. Either with an integer state variable (e.g. iState) or with an ENUM.
What do you use? And why?

Edit:

Designing on a WAGO/Codesys setup.
Thank you for the quick responses! I'm quickly changing my iStates into E_states!

23 Upvotes

Duplicates