LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daq 6008 does not acquire signals

Hello,

 

The program below does not read the analog inputs, with the MAX i can read the voltage but i can not read anything in the indicators and the graphs.

Any advise? I don't know what I'm doing wrong? Thanks in advance.

0 Kudos
Message 1 of 9
(3,781 Views)

Are you getting any error messages?

 

From what I can see, you should be.  You should be gettint error -50103.

 

You can't have 4 DAQ assistants all pointing to different channels on the same device.  You'll get an error about the resource being reserved.

 

You need to have one DAQ assistant that contains all of your channels in a single task.

0 Kudos
Message 2 of 9
(3,767 Views)

When you set up MAX to read your device, you specify the device, the channel(s) you want to read, the sampling rate, the voltage range, number of samples, and whether or not you want continuous.  Before you leave MAX, save all of those settings as a MAX Task and give it a name you'll remember.  Now, when you configure your DAQ task, use the Task you just configured in MAX.  Of course, this assumes that you are not using the DAQ Assistant, but instead are using the basic DAQ functions so well described here.

 

Bob Schor

0 Kudos
Message 3 of 9
(3,747 Views)

Make sure your not trying to run it while MAX is running. I learned that one the hard way.

0 Kudos
Message 4 of 9
(3,733 Views)

hello all,

i tried already to make it with one daq assistant getting same result: just one error in the daqmx create virtual do channel error 20099 but not the error liste 500....

besides this in the daq assistant no error and no results shown in the indicators or graphs.

could you give me an example how to implement it with my program

i'll not runt it with max simultaneously . thank you

0 Kudos
Message 5 of 9
(3,701 Views)

I don't have any hardware at home, so I created a simulated 6009 (which I think is very similar to the 6008).  I created a Task called 4-line DO and wired it in to the Start DAQ function.

 

Something to note -- while the USB 6009 has a very good clock for sampling, I don't think it has a clock for timed outputs, depending on you delivering the points via USB (which isn't very fast).  I'm pretty sure that Analog Output is limited to something like 100Hz.

 

Anyway, here is a simple DAQ Output routine:

Simple DAQ Out.png

Bob Schor

0 Kudos
Message 6 of 9
(3,681 Views)

Are you sure about that error number 20099?  My guess is that it is -200099, which means "Physical Channel not specified".  Since your Digital I/O control is empty by default, I'm wondering if you are forgetting to enter a channel there before starting your VI.

 

You can usually help yourself in debugging by taking careful note of the error numbers, reading what they say, and putting probes on error wires so you can see exactly where the errors occur.

0 Kudos
Message 7 of 9
(3,670 Views)
hello, I set the lines for the digital outputs and started working acquisition for ai1 but with this error -200279 for the other ai2,3 and 4 no signal. one thing that happens is that sometimes the ai shows voltage without any voltage connected on it , for example when i switch voltage from input 1 to input 2 input 1 still shows 1,4v??? have a look.
0 Kudos
Message 8 of 9
(3,648 Views)

I apologize for not looking more carefully at what you are trying to do.  I didn't see that you are doing both Digital Out and Analog In.

 

I now have my USB 6009 connected, so I can actually test things with MAX.  I made a task, 4-Chan DO, that does a 1-sample On Demand write to port 0, lines 0 through 3 (all at once).  I made a second task, 4-Chan AI, that samples AI0 through AI3 using Continous Samples, 1000 samples at 1KHz.  The channels are set to ±10v, differential.

 

Here's the VI that handles this.  I made the Chart Y scale fixed at ±0.1 v, as nothing is wired to my inputs so I'm only seeing "noise" -- if I let it autoscale, it jumps around and isn't pretty to view.

 

DAQ AI-DO Task.png

 

Some things to note:

  • Because I used named Tasks created in MAX, I can simply wire the Task to the DAQmx Start and it "knows" the channels and other details of the task.
  • Because the AI task is running on the 6009's very precise Sampling clock, the While loop "clocks itself" at 1 loop per second (the time it takes to sample 1000 points at 1KHz).  No timing functions are needed in the loop.
  • Only three DAQmx functions are needed for each sub-task.  [I could add Dispose Task, but that's not really necessary here].
  • The hardest thing to get right is the input to the DI task.  Having MAX open and looking carefully how I defined the Task showed I was calling it "Several boolean channels", not a Port, so I created "several (4) boolean channels" and the errors went away.
  • I took some shortcuts in the 4-bit digital counter.  The index "i" is really 32-bit, the U8 conversion makes it 8 bits, and taking the first four elements of the boolean array makes it 4 bits.

Bob Schor

0 Kudos
Message 9 of 9
(3,606 Views)