LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get and display voltage value in Labview?

First a little background:

 

I am a college student doing an internship at a university and my project for the summer involves load cells. I am planning to use LabVIEW as both a multimeter and a calculator that would convert the voltage given off by the load cell into the force exerted on the load cell.

 

Now here comes the situation:

 

I have gotten everything hooked up and the load cell is working fine when using a standard multimeter. The data acquisition card is also working fine (The dac is the Measurement Computing USB-2416) as it was reading the same voltages as the multimeter. So all that was left is to put a numerical indicator and use some block code to send the voltage amounts to the indicator.

 

But the problem is: I simply do not know how to make the proper coding and the Internet is of no help to me on this subject.

 

My first thought is to do something using AIn() like the first attached picture show, but that resulted in an error stating:

 

"This function can not be used with this board."

 

Which is odd, for I am sure this is the right function to get analog readings from the dac.

 

Then I do something like the second picture, which does not produce an error, but it does produce a value of 255, which is obviously not correct.

 

At that point, I went on the Internet to get some answers, only to return with no answers at all.

 

And now, I turn to you guys to help me, for I have a single big question:

 

Which blocks/code should I use to obtain a voltage from a dac like the Measurement Computing USB 2416 I am using?

 

Summary of details:

 

  • The DAC I am using is the Measurement Computing USB-2416
  • The DAC is loaded with the latest drivers and Instacal was used as well
  • The LabVIEW I am using is LabVIEW 2012 version 12, 32 bit.
  • I got ULx and Universal Library for LabVIEW installed.
  • The operating system is Windows 7 working on a desktop that is a few years obsolete.

With that being said, can you guys help me out, please?

 

Download All
0 Kudos
Message 1 of 10
(6,299 Views)

One first step is to go to the block diagram, right click, select: Measurement I/O -> NI-DAQmx -> DAQ Assistant. Place it on the block diagram. It should then ask you several questions about your setup.

0 Kudos
Message 2 of 10
(6,289 Views)

Hmm....

 

I looked in Measurement I/O, but I do not see NI-DAQmx...

0 Kudos
Message 3 of 10
(6,283 Views)

My mistake, I should have searched the forums, first. Here's an idea:

 

http://forums.ni.com/t5/LabVIEW/Are-there-drivers-for-the-MCC-USB-2416-and-USB-TC/td-p/1811302

0 Kudos
Message 4 of 10
(6,275 Views)

Hmm. Does InstaCal and the entire package counts as drivers? If so, then I already have the drivers if you are asking that.

 

But the DASYLab looks interesting...

0 Kudos
Message 5 of 10
(6,267 Views)

I don't have those drivers or VIs installed. I should have kept my mouth shut about it. Are there any examples in the folder where the VIs are? (Create a project, add a VI that calls the AIn, then look at the Files View to see what folder they're in.)

0 Kudos
Message 6 of 10
(6,257 Views)

If you installed the entire Measurement Computing MCC-DAQ CD, you will have installed the ULx for NI LabVIEW. It comes with a bunch of examples. It makes sense to open those examples, and use them as the starting point. 

 

Take a look at the Quick Start for the ULx for LabVIEW - http://www.mccdaq.com/pdfs/manuals/QS%20ULx%20for%20NI%20LabVIEW.pdf

 

Also, the more comprehensive help: http://www.mccdaq.com/pdfs/manuals/lvulx.zip

 

As you can see, there are quite a few examples.

 

2013_08_07_PrintScreen_0000.png

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 7 of 10
(6,229 Views)

CJ is correct.  I would have gone with this example:

C:\Program Files\National Instruments\LabVIEW 2012\examples\ULx\Analog In\Measure Slow Varying Signal.llb\ULx Cont Acq&Chart Samples-SW Timed.vi

or

C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\ULx\Analog In\Measure Slow Varying Signal.llb\ULx Cont Acq&Chart Samples-SW Timed.vi

 if you are running 32 bit version.

 

Only because it is continuous, but the single sample one will also do the job.

 

Also there are 3 KB articles I wrote, on getting started with ULx and LV with MCC hardware:

http://kb.mccdaq.com/KnowledgebaseArticle50357.aspx

http://kb.mccdaq.com/KnowledgebaseArticle50358.aspx

http://kb.mccdaq.com/KnowledgebaseArticle50359.aspx

 

They all feature the 1608GX but will work for any mcc hardware.

0 Kudos
Message 8 of 10
(6,214 Views)

An update:

 

I tried to run some examples related to reading analog signals, but all of them are coming up with the same error:

 

Lab View Help 4.png

 

That is strange and fustrating, because the device clearly supports analog signals and inputs, judging from what InstaCal told me!

0 Kudos
Message 9 of 10
(6,196 Views)

That is strange.  I ran the example I suggested you try before and just now.  it is working correctly wih the USB-2416.  I tried with the '2416 configured for both voltage then temperature.

 

Did you run this particular example?  ULx Cont Acq&Chart Samples-SW Timed.vi

 

It defaults to board 0, channel 0.  Is the USB-2416 board 0 in InstaCal?

 

an important rule to note:  NEVER have InstaCal and LabVIEW open at the same time. if you find you do, you need to close both, all the way, then start only the program you want to use.  this is because the MCC drivers are not multi threaded.  I suggest you close LabVIEW all the way down, then restart it and see if the problem goes away.

 

Best regards,

Jeff

0 Kudos
Message 10 of 10
(6,182 Views)