Join us today!

Local Enumeration D...
 
Notifications
Clear all

Local Enumeration Declaration

2 Posts
2 Users
3 Reactions
382 Views
TwinControls
Posts: 71
Admin
Topic starter
(@beckhoffsupport)
Member
Joined: 2 years ago

If you don't want to create an enum which is accessible globally, you can declare it implicitly in your local program. This is not allowed in methods and also as an output though.

//=========================================================
VAR
    eMachineState : (RUNNING, STOPPED, ERROR, PAUSED); //implicit, local enum declaration
END_VAR
//=========================================================
CASE eMachineState OF
     
    RUNNING : 
         // Code
 
    STOPPED :
         // Code
 
    ERROR :
         // Code
 
    PAUSED : 
         // Code
END_CASE
//=========================================================

 

Give it a try! 

Reply
1 Reply
rruiter
Posts: 63
(@rruiter)
Estimable Member
Joined: 2 years ago
Reply
Share: