04-15-2009 11:17 AM
Attached below are the 2 programs we are trying to integrate. The main program will record video on an 11 second loop. Currently the loop stops recording the video when the stop button is pressed and saves the avi file to the desktop. The other program will actively monitor a voltage source and report the voltage until the stop button is pressed. What I want to do is have the main program stop the loop when the voltage goes higher than 5 volts. I know that I can set that part up with a comparator to stop, and that is easy.
I am currently having problems getting the two programs meshed together. When I try to do it, I can either get the video to record and not update the voltage real time, or to update the voltage real time but not record the video. I can't figure out where to place the parts of the voltage reading program into the main program so that it works the way I want.
Any help will be greatly appreciated.
Thanks
04-15-2009 03:08 PM
04-15-2009 03:28 PM
try and put the code from "read voltage.vi" into "grab and record final.vi" and check the voltage everytime the loop checks to see if the stop button was pressed and then use an OR to decide whether or not to stop.
hopefully this helps
04-15-2009 03:45 PM
04-15-2009 07:05 PM
I have tried what you posted. It doesn't appear to read the voltage data in real time.
Also after the first 11 seconds the program crashes saying that an error occured at the DAQmx read vi and that it is attempting to read samples that are no longer available.
Any ideas? I need the voltage to read real time so that the video stops the instant that 5 volts is detected.
04-15-2009 07:21 PM
04-15-2009 07:33 PM
04-15-2009 07:45 PM
04-15-2009 09:14 PM
04-16-2009 11:09 AM
I made two parallel loops. I am just trying to use the voltage data from the read loop to end the video record loop. I have kept them parallel. With the parallel loops I can get the voltage to update real time, and at the same time I can get the video to record. However, they each have their own respective stop buttons. I want the voltage data to be able to stop the video recording and its not working. The voltage will read real time, but the video will not record until I hit the stop button for the voltage reading.