LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ newbie help on graphing

Solved!
Go to solution

Hello all,

 

I am quite new to DAQs and programming in general, but my project is not very complicated in scope, so I hope to be able to do this with some help.This is more of how to use LabVIEW question, not an application specific question.

 

I am using a sample template program provided by LabVIEW: "Continuous Measurement and Logging (NI-DAQ)", and looking for a way for this program to show a graph value going from 850 to 1200 when it reads 0 to 10 V from a source.

 

Quite simply, 0v = 850 BTU and 10v = 1200 BTU, so each 1V is in 35 BTU steps.

 

I have the NI DAQ USB-6000 ordered so I can't play around with it plugged in yet, but looking to prep the program up a little to get going when it arrives.

 

Thank you so much for your help and I hope I provided a good enough context to be clear.

 

 

 

 

0 Kudos
Message 1 of 7
(2,258 Views)

Don't have LabVIEW with me, but look at the property nodes for the plot, specifically the y- scaling and offset; there you can add your offset and scaling factor.

 

mcduff

Message 2 of 7
(2,219 Views)

Well, suppose you read voltage from your DAQ device, and the values (in volts) go from 0 to 10.  You already know that 0 V = 850 BTU, 10 V = 1200 BTU, the relationship is linear, so BTU = 850 + 35 * V.

 

Suppose you have an array of Voltages (say, 1000 samples taken at 1 kHz).  Multiply the Array by 35, add 850, and Presto, you have 1000 BTU samples, just plot them!

 

There are excellent tutorials on DAQmx that you can find on the Web.  The scaling that I described above can even be done within DAQmx so that it outputs not in units of Volts, but directly in BTUs.

 

Bob Schor

 

Message 3 of 7
(2,207 Views)
Solution
Accepted by topic author Buriza-doKaynon

I would just make DAQmx do the scaling for you.  Search for the DAQmx Create Scale function.  It is buried in the Measurement I/O->NI DAQmx->Advanced->DAQmx Scale Setup palette.  You can choose the Map Ranges instance from the drop down and apply your ranges there.  It will do all of the math for you.  You just apply this scale to your channel when you set it up.  Now the output of the DAQmx Read will be in BTU for you.  Life becomes a lot easier.

 

Do note that the DAQmx Create Virtual Channel wants Maximum and Minimum based on the values AFTER the scale was applied.  So you will need to update those values as well.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(2,146 Views)

Thanks for the help, yes I think letting the DAQmx doing the scaling, and displaying that direct BTU value would be the best way. 

 

Really appreciate everyone's response on this one. I'll be sticking around to learn! Thanks again!

0 Kudos
Message 5 of 7
(2,128 Views)

@Buriza-doKaynon wrote:

Thanks for the help, yes I think letting the DAQmx doing the scaling, and displaying that direct BTU value would be the best way. 

 

Really appreciate everyone's response on this one. I'll be sticking around to learn! Thanks again!


DAQmx Scales are very under-appreciated.   I commend crossrulz for pointing out that built in feature!  Do be aware that when you use a scale ranges are in the scaled values.  That last tidbit can cause unexpected consequences. (And some frustration when wanting to optomize the DAQmx Channel range)  eg if 0V is 850 BTU and 10V is 1250 BTU setting a minimum range of 450 and a max of 1250 takes a bit of math to know the DAQ device is +/-10V with a gain of m and an offset of b


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 7
(2,096 Views)

@JÞB wrote:

eg if 0V is 850 BTU and 10V is 1250 BTU setting a minimum range of 450 and a max of 1250 takes a bit of math to know the DAQ device is +/-10V with a gain of m and an offset of b

I avoid that by getting people to think about what the final measurement is.  No need for them to do the math.  Only the circuit designer really needs to know the voltage range for device safety purposes.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(2,077 Views)