12-16-2008 11:39 AM
12-16-2008 12:46 PM
12-16-2008 01:10 PM
12-17-2008 11:14 AM
12-17-2008 08:19 PM
Basically, I'm using a USB NI 6225 that reads voltages and i'm sending in a constant current to get a resistance. The threshold resistance is one. If the voltage and current exceed one ohm, then I want to save that value to a file, turn on a led, capture four more seconds of data, then stop my program....my question is, how do i capture four more seconds of data after my resistance has exceeded 1 ohm and then automatically shut the program down after it's capture 4 more seconds of data.
12-18-2008 08:44 AM
I'm still not sure if it's the hardware or software you are having trouble with. If you are already acquring data with that device in LabVIEW, then it would seem you already have the LabVIEW skills to setup the simple structure you are requesting -- that's why I'm wondering what exactly you are having trouble with.
See attached VI.
12-18-2008 01:20 PM
So what we are working on is the process of triggering at a threshold and saving the next four seconds of data. Broken Arrow's suggestion seems to work as long as the your acquired value does not go below your threshold after the initial trigger.
If it is possible that your data will go below your threshold again, you will need to add additional code to compensate for that. Another method is to use a DAQmx Analog Trigger. Then just use a Time Elapsed VI to govern the acquisition loop for 4 seconds.
12-18-2008 08:06 PM - edited 12-18-2008 08:07 PM
I would follow Will's advice concerning the DAQ trigger. "Broken Arrow's suggestion seems to work as long as the your acquired value does not go below your threshold after the initial trigger." Broken Arrow gave you a great starting point.
In case someone else who reads this doesn't have DAQmx I worked up this model. Note that using an ever expanding array as I did is hard on memory.
Any other comments or examples concerning this are appreciated. (hope to make Rube Goldberg eventually
).
12-18-2008 09:04 PM - edited 12-18-2008 09:07 PM
Building an array in a loop can be detrimental, leading to crashin.
A state machine is required for rechecking the threshold / resetting the timer, etc. a.k.a. Hysteresis.