03-04-2007 04:16 PM
03-04-2007 05:34 PM - edited 03-04-2007 05:34 PM
Event structures are mainly designed for user interaction and don't react to programmatic changes for very good reasons.
To programmatically trigger an event, you can write to a singaling property of the control or indicator. Be aware that this will always trigger so you would need some logic so the signaling property is only written if the LED goes from Off to On, and not every 100 ms. Use a shift register and an "implies" function in the left loop for this.
You should also guarantee that the event time is shorter than the time between triggers.
Maybe there is a better way to do all this. What exactly are you trying to do?
Message Edited by altenbach on 03-04-2007 03:36 PM
03-04-2007 10:19 PM
Hi Altenbach, thanks for your reply - I've made the changes you suggested and it does seem much cleaner (and smarter :).
Basically, this program will be part of a test jig to test 2 circuits independently. A circuits is plugged in, a physical button is pressed, and the test commences on that circuit. Later on, while the first test is going, a second circuit could be plugged in, a second physical button could be pressed, and another test is carried out on the second circuit.
The operator of the jig won't be interacting with labview directly - the only input will be this physical button, which is pressed and sends a 2-second high signal to the DAQ card. So, I'm trying to write this TestFP.vi to 'poll' the DAQ card inputs (100ms is probably too often, could be 500ms or 1.9s just as easily), and then when one of the buttons is pressed, and the DAQ input goes high, it will run the appropriate test program. While this program is running, button presses should have no effect, but once the test has finished, you can replace the circuit on the test jig, press the button, and the test will start up again on the new circuit.
I started using the event structure because of the ValueChange and Oldval/Newval properties. It seemed to me to be a little more difficult to use just a case structure or something similar to make this process: 1. check if DAQ input has gone low to high 2. as long as test program isn't running already for this circuit, start the test program.
I'd appreciate any more help you or any others can give me, thanks in advance.
03-05-2007 03:56 PM
03-06-2007 12:58 PM