LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in ADC acquisition

Hi,

I am new to Labview. I am using NI USB 6211. I have taken following example project of ADC acquisition, 

1. voltage(with events) - continuous input.vi

2. voltage- continuous input.vi

3. voltage-Finite input.vi

4. voltage- SW timed input.vi

I tried to run the project, and connected input to the respective physical channel. For example, if the physical channel is displayed as "dev/ai1", I connected input voltage source to AI1, pin 17 mentioned in the attached snap shot. I connected ground to AI GND. But I am not observing any output through the waveform graph. I tried to measure the input using multimeter, and it displayed correctly. Not sure where the issue. I am using continuous time mode but not triggered mode initially. Could you please let me know where the issue is. The project which I used is example project. 

 

Thanks

Ramesh B

0 Kudos
Message 1 of 7
(3,501 Views)

Hi, Ramesh.

 

     When learning to use LabVIEW to acquire data from NI hardware, the first thing you should do, before opening LabVIEW and writing any code, is to use MAX, NI's Measurem     ent and Automation Explorer, and "explore" your NI hardware.  If you installed LabVIEW and the DAQmx Drivers you would need to acquire data with LabVIEW, then NI MAX should be sitting as an Icon on your Desktop (depending on the version of LabVIEW you are using, it looks like a stylized Eagle and the letter "N").  Here's what you do:

  • Plug in your Device.
  • Start MAX.  Wait for it to open.
  • On the left, expand Devices and Interfaces.  Look for your Device.  Click/select it.
  • On the right, you will be able to open a Test Panel.  This will give you access to the sub-systems of your device, such as the Analog Inputs.
  • Select Analog Inputs.  Choose a Channel (you seem to be using AI1).  Look at what you can configure, and set it up however it seems sensible to you.  I recommend, while trying it out, you set it for Continuous Sampling, 1000 samples at 1KHz (the defaults, I think).
  • So you can "see something", connect a 1MOhm resistor (the value isn't important) across the A/D inputs.  You want to look at "noise" and not burn anything out in the process.
  • Start acquiring.  You should see a noisy trace (the graph will scale to magnify the signal).  Touch the end of the resistor connected to AI1 -- the noise should get much bigger (you are very noisy!).  Now you know your device works, so if your code doesn't show data, it's Software, not Hardware.

Bob Schor

 

 

 

0 Kudos
Message 2 of 7
(3,497 Views)

Hi Bob,

First of all, I thank you very much for the helping. I have done as you mentioned. I connected, 5kohms resistance between AI1 to GND but not connected any voltage source at AI1. When this is measured in multimeter, it shows 3mv(seems leakage or offset). The ADC (test mode) shows the output as follows. 

 

May I know if this means, ADC is working fine?

 

Thanks

Ramesh B

0 Kudos
Message 3 of 7
(3,467 Views)

Hi Bob,

The adc is working fine in continuous sampling mode. I have the application requirements and I tried to configure as follows. 

The ADC should sample only when the input trigger is appeared. Once ADC samples the input, it should wait for next trigger to sample it. Once the input is sampled, the conversion time should be ADC clock frequency speed. Only the starting of the conversion should depend on the external trigger., 

I saw option called 'Digital start' and 'Digital reference' but I am still not understood, for the above configuration, what should be the ADC mode. Should this be,

1. finite sample

2. continuous sample

3. Hardware Timed signal point. 

In Hardware timed signal point, I am always getting "error -200278" and I am not able to fix it. It is just example project of "voltage-continuous input.vi" with different triggering mode. 

 

Thanks for your help. 

 

Thanks

Ramesh B 

0 Kudos
Message 4 of 7
(3,456 Views)

When the Trigger is present, do you want to sample one point, or do you want to trigger a "sweep" (like with an oscilloscope) and sample, say, 1000 points at 1 kHz?  If one point, then you want "Hardware-timed single point", if a "sweep", you want "Finite sample", if "start sampling at the trigger and continue until I tell you to stop", you want "Continuous".

 

I don't have your DAQ device, but MAX might give you those choices, and you could see what they do.  I don't have MAX open, but I think there is Help that also might explain the sampling modes.  And there's the LabVIEW Forum...

 

Bob Schor

0 Kudos
Message 5 of 7
(3,446 Views)

Hi Bob,

The DAQ device which I am using is NI USB 6211. I want to acquire only one sample after the trigger appears. It could be either pre-trigger or post trigger. When I use the hardware trigger single point, it shows the error as follows:

 

Error -200077 occurred at DAQmx Timing (Sample Clock).vi:4730001

Possible reason(s):

Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.

Property: SampQuant.SampMode
Requested Value: Hardware Timed Single Point
Possible Values: Finite Samples, Continuous Samples

Task Name: _unnamedTask<4E8>

 

 

When I specify thy finite sample with no of samples as 2, I got this error as follows:

 

Error -200278 occurred at Voltage - Continuous Input.vi

Possible reason(s):

Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.

Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.

Attempted to Read Sample: 2
Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<4E7>

 

I am not sure, what could be done to accomplish this task. I came to know that the digital reference triggering is not supported in this device, so only digital start is supported. I attached the example project here as the reference. 

 

Thanks

Ramesh B

0 Kudos
Message 6 of 7
(3,428 Views)

Hi Bob,

In addition to my previous reply, I would like to add this also.

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PA1PSAW

In the above link, it mentions that to use the finite sample mode, remove while loop. When DAQmx Read is out of while loop, the acquisition starts when I manually click the "Run" option in the terminal. It is not responding to the trigger input which appears as 1 seconds. I am not sure how to use the trigger to sample exactly at that instant, and acquire only finite number of sample at that instant (1 or 2). Hardware timed single point seems not supported for this DAQ device NI USB 6211, if it is usb powered(as per the below KBA).

 

http://www.ni.com/product-documentation/54449/en/

 

let me know if there are any other ways to use the DAQmx for adc acquisition with hardware triggering and acquire only one or 2 sample during triggering. I need to check this with both pre-triggered and post- triggered for my application. 

 

When I use DAQ assistant block to my program with my original project, it completely slows down the original digital logic. That's why I am preferring to use the DAQmx for acquisition.  

 

 

0 Kudos
Message 7 of 7
(3,422 Views)