09-06-2016
12:38 AM
- last edited on
05-13-2025
02:02 PM
by
Content Cleaner
By the way, you VI does not reflect exactly the example given here: https://www.ni.com/en/support/documentation/supplemental/16/simple-state-machine-template-documentat...
You could change the number representations in your Typedef enum into some text, as shown in the above example. Then it is easier for you to visualize how the code works (Start, 5 cents, 10 cents, Dispense). If you programmed your VI in the proper way, and you have a single Typedef enum in all places where needed, you just need to right click the typedef, and edit it, then save it. This change will be done immediately at ALL places in your VI! Do you see the power of a typedef? Now imagine a VI with an enum which is used at 100 places in the code...Not using a typdef, you would need to change MANUALLY all 100 instances 🙂
09-06-2016 12:41 AM
Thank you for the help. I made a mistake in case assignment instead of writing the string format "1","2","3" I wrote it as numeric constant 1,2,3.
09-06-2016 12:53 AM
Let LabVIEW make the case assignment for you, thus avoiding possible typing mistakes (connect the typedef enum to a Case structure, then right click the Case):
09-06-2016 12:57 AM
Oh thank you for letting me know this.
09-06-2016 01:02 AM