10-11-2019 05:08 PM
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.
Solved! Go to Solution.
10-11-2019 08:24 PM
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
10-11-2019 08:59 PM
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
10-14-2019 07:33 AM - edited 10-14-2019 07:35 AM
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.
10-14-2019 02:56 PM
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!
10-16-2019 03:04 PM - edited 10-16-2019 03:15 PM
@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
10-17-2019 06:14 AM
@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.