i'm just starting out so any help is appreciated.
Two question "1" is general and "2" is specific.
1. When an event structure is in a while loop the while loop only iterates when the event occurs. What is the reasoning behind this and why can't a single while loop contain other code that gets polled or executed with every iteration?
2. I'm having issues with the attached code. Two main issues that i don't quite understand. I'm trying to have make a code that will do several things on the front panel at particular time intervals. I would like it to throw up a message to the user and also enable and disable some controls. While all of this is happening i will be collecting data and doing some PID control on the some IOs. The full code is not attached but basically my plan is this. One loop for PID and DAQ functions. Loop 2 for event structures such as messaging and enabling and disabling controls etc.... Loop 3 for timing of the user input.
What i'm having trouble with is loop 2 and 3 which is what's in the attached in the simplified form.
a. When button1 is pressed and action is set to "switch until released" my message 1 appears twice. This makes sense as the button switches from F to T to F. How do i get the even to trigger only one time on the press of the button if i want the button to be momentary? I can get this to work when i switch the action to "latch" which makes sense because it changes state once per click?!?! Also when i connect an LED to that button the LED never goes off once it's turned on, whats the explanation here?
b. The biggest mystery to me is the timing in Loop 3. I'm using the "time has elapsed" output of the elapsed time VI to trigger the event and pop up message 2. If this was working correctly i suspect that the message would pop-up twice as this goes from F to T to F. But the event is triggered continually and i'm not sure why? Based on the indicator it should only trigger once every 10seconds not every loop iteration. Also there is an element of question "a" here when this is working correctly how do I trigger only one event based on the FTF output of elapsed time?
What is the proper way of programming this and what am i doing wrong/missing?
Appreciate any help or guidance.