LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving-To-File Data

I'm writing a simple program that divides voltage by current to get resistance. If the resistance exceeds a threshold value, then I want a L.E.D. to come on and save that exceeded value to a value. But, if the value exceeds a threshold value, I want the program to automatically stop running after 4 seconds....so, I want to program to capture 4 seconds of data once the value exceeds and then stop the program
0 Kudos
Message 1 of 9
(3,667 Views)
OK, so you've given us the requirements, but what is your question ?
Richard






Message 2 of 9
(3,651 Views)
show us what you have so far and we'll help from there
Cory K
0 Kudos
Message 3 of 9
(3,639 Views)
If you're curious about how to turn on an LED and begin the write-to-file process based on a threshold value, I would recommend using a case structure that is defined by the data input. Also use this case structure to trigger your timer.
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 4 of 9
(3,607 Views)

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.

 

 

0 Kudos
Message 5 of 9
(3,586 Views)

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.

Richard






0 Kudos
Message 6 of 9
(3,572 Views)

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.

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 7 of 9
(3,552 Views)

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. Smiley Happy 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 Smiley Very Happy).

Message Edited by GovBob on 12-18-2008 08:07 PM
Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 8 of 9
(3,533 Views)

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.

Message Edited by Broken Arrow on 12-18-2008 09:07 PM
Richard






0 Kudos
Message 9 of 9
(3,528 Views)