06-26-2014 07:48 PM
Hello,
Operating with: X Series 6351 USB DAQ, Windows 7, Labview 2013 SP1
Relative newbie, but not completely. Have completed Self Paced Training Core 1 and created a data processing VI for R&D but still new enough to be dangerous...
Purpose: Trying to take the aforementioned R&D VI and convert it into a production tester. It turns on a medical surgeon's tool. This is essentially an enclosed motor in a "drill housing" let's say, that I am turning on with a relay using a medical power supply it's attached to. I then break the phases with another multipole relay and read the back EMF to get zero crossings, speed, deceleration, friction etc. all calculated values.
In the R&D version I turned the motor on with a Boolean switch that activated the relay. I used a powered pole on the relay to notify the VI that it had indeed been energized, and turned on the 2nd relay after a 3 second time delay. The trouble is, production wants a run-in on the handpiece to set the bearing and they want it to be 8 minutes. My time delay, using a Property Node won't give me a delay that long... hence my dilemma. I'm sure there is a relatively easy way to set up a delay timer in my VI, but I'm not smart enough yet to figure out the best way to accomplish this. Event structure? State machine? Also would like to turn off the Boolean switch programmatically. I am running out of time on this project and I would sure appreciate a point in the right direction. I attached the full VI and a screen shot of the area I'm having trouble with. Much obliged for any help and please pardon the spagetti code. I will get more proficient with practice and some NI training beyond the self-paced stuff I hope.
Scott Wargo
Senior R&D Technician
I
06-27-2014 09:10 AM
The easiest way to do this would be to use the Time Delay express VI. An example of it's implementation is as follows:
Also, some quick feedback on your code in general if you'd like it. Often beginners (and veterans) will create "spaghetti" when wiring everything together but your's is nice and clean. Good job!
There are a few minor improvements I could see though.
First, you have error handlers in multiple places. Typically you want to merge all of the error wires to a single error handler at the end of the execution.
Also, and this is somewhat of a personal preference, I would recommend arranging pieces of code that run parallel (turn on handpiece, break power to handpiece and your main code) in a vertical fashion. This makes it easier to visualize (at least for me), and also makes it easier to run the error wires in parallel before merging everything together at the end to the single error handler as mentioned above.
You might also re-evaluate your DAQ flow, particularly the while loop in the turn on handpiece section. I'm not sure it does what you are after.