Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

how do I read a voltage and turn off a relay

First, I am new to DAQexpress


My goal is simple:  Plot a discharge curve for a battery with a load across it, then disconnect the load when the voltage drops below a threshold to prevent damaging the battery.


I can chart a battery voltage using NI USB 6008.  I can turn the relay on and off with a digital output.  But I can't figure out how to compare the voltage data stream (1D waveform?) to a constant to turn off the relay.  There is a data type mismatch that I don't understand.


Should be simple, but I am stumped!

Please help if you can.




0 Kudos
Message 1 of 6

Not sure how much you can program in DAQ express. Can you show us your code.

0 Kudos
Message 2 of 6




not sure how to upload code...  My problems seem to be related to mismatched data types.  Can't compare a 1D waveform from the DAQ to a constant.  not sure how to trigger the DAQ digital out from a boolean comparison

0 Kudos
Message 3 of 6

You should be able to get the y component of the waveform and index out the last element.


(Sorry, I don't have DAQexpress, but it looks similar to NXT.)

0 Kudos
Message 4 of 6

was not able to figure out how to get the y component and index to the last element. got it sort of working by changing the DAQmx data format from waveform to "floating Point".  but now, after 1000 while loops, I get this error:


 here is what the code looks like:




0 Kudos
Message 5 of 6

Can I suggest you bypass all the data aquisition and programming and just use a trip amplifier?




This will mean that your battery protection is independant of your computer & software.

0 Kudos
Message 6 of 6