I'm a newbie to Labview and I'm learning with some small tasks. I've created a traffic light system using a case structure/state machine that cycles through the RED, AMBER, GREEN colours.
What I would like to do now is put a button on the front panel that if pressed sets the traffic light to RED permanently, like in the event of an accident, and then when switched back or off the sequence resumes.
I've done some searches and with the case selection being text and buttons being boolean I'm struggling to come up with a reasonably solution.
Thanks in advance for any advice help.
Solved! Go to Solution.
Here is a slightly cleaned up version which accomplishes what you were looking for.
Some general notes about LabVIEW coding. Try to keep your block diagram neat and organized. That means minimize bends in wires and align your nodes. This helps make teh code much easier to read. In addition, the ENUMs in this code should be a typedefed ENUM. That way is you need to modify the ENUM all copies of it will be updated. If you simply copy and paster them you have to manually edit every one. (I didn't create the typedef and replace all the copies for you.) You would need a better state machine to handle the delay if you wanted to handle the accident condition in a more timely fashion. The "Wait" state would not wait the full duration but a small fraction of the time and repeat until your reach the desired time. This would allow the lights to switch to Red very quickly after the accident condition.
Thank you Mark for the reply and the coding advice.
Your solution appears clear and simple which is what I was hoping for.
I will look at the code tomorrow as its 12.30am and I havn't got Labview on this machine.