Join us today!
Notifications
Clear all
Local Enumeration Declaration
Aug 29, 2022 1:57 pm
(@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!
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
Reply
Topic Tags
1 Reply
Aug 31, 2022 5:34 am
(@rruiter)
Estimable Member
Joined: 2 years ago
Jakob Sagatowski also wrote a good article on this.
My blog: https://cookncode.com/twincat
My code: https://github.com/roald87
Reply
TwinControls reacted
Forum Jump:
Related Topics
-
Converting REAL to 2 WORDS
2 years ago
-
Multi-line editing in TwinCAT
2 years ago
Forum Information
- 17 Forums
- 267 Topics
- 924 Posts
- 0 Online
- 737 Members
Our newest member: KarenTox
Latest Post: Watchdog Timers Expiring During Multi Download
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed