LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni-DAQmx LabView examples won't work

Hi,

I'm running LabView 7.0 Student Edition, Ni-DAQmx Base 2.0 and using a USB-6009.  I'm new to LabView and all of this, so I ran through the examples in the Getting Started manual, and then opened the examples for LabView that came with Ni-DAQmx.  I am trying to output a 5V signal from my USB-6009, or nothing, depending on what I decide.  I need it to be continuous because it's flipping a switch on my physical electrical circuit.  Simple, right? 

Except I can't get the examples from Ni-DAQmx to work!  All the analog output examples that I try and run come up with a "error -200428" when in the block diagram comments it say the default task should work.  So I tried to enter my own task, and that doesn't work either.

I'm sure this is a very simple problem, but I am completely new to all of this, and am struggling to learn it all on my own, in a very restricted amount of time.  Please, help! Smiley Sad
0 Kudos
Message 1 of 13
(3,668 Views)
The example Gen Voltage Update.vi looks like it should work perfectly for my purposes... in the dynamic folder.  Even better, i don't have to select a task!  So i chose a0 on my USB-6009 on the physical channel drop down, everything looks good... and same error.  I don't know what to do.
0 Kudos
Message 2 of 13
(3,663 Views)
One of your problems is that you have DAQmx base installed and are trying to run DAQmx examples. DAQmx base and DAQmx are two different drivers. There are different examples that ship with DAQmx base or you can install DAQmx. The latest version of DAQmx that supports LabVIEW 7.0 is 8.1. You'll also have to be careful which examples you use in DAQmx. Your device only supports software timed analog output.
0 Kudos
Message 3 of 13
(3,651 Views)
You said:

One of your problems is that you have DAQmx base installed and are trying to run DAQmx examples. DAQmx base and DAQmx are two different drivers. There are different examples that ship with DAQmx base or you can install DAQmx. The latest version of DAQmx that supports LabVIEW 7.0 is 8.1. You'll also have to be careful which examples you use in DAQmx. Your device only supports software timed analog output.



I have DAQmx 8.0 that came with my USB-6009, and it is installed.  I also have DAQmx base.  There are no real good examples with DAQmx in their getting started guide, and the task assistant hates me.

I realize the my device will only allow the on demand tasks.  But I thought that this example had worked around that.  Unless you're saying that my device doesn't support DAQmx Base Smiley Indifferent

I'm sorry, I know this seems all so simple to everyone else, but I've never used these programs or any similar programs before, and I don't have anyone I can turn to for help.  All I want to do is output 5 or 0V depending on what I enter, or toggle if I use a T/F setup (I know how to do that).  But the DAQ Assistant and mxBase functions all boggle my mind.

Are there any DAQmx Base example that you know will work with my device?  Or am I defining my task wrong?  (All I do is pick ao0, analog output voltage, max 5V min 0V, and sample on demand).  It would absolutely make my day if someone could help me with this.

Thank you so much!!!
0 Kudos
Message 4 of 13
(3,643 Views)
Which driver do you actually have installed and active for the device? How does it show up in MAX (Measurement & Automation Explorer)? I think you should be using DAQmx and not DAQmx base and the examples for DAQmx are in the LabVIEW Example Finder (Help>Find Examples). In order to use the DAQ Assistant, you have to be using DAQmx. Here's a couple of links that deal with both DAQmx and DAQmx base installed.
 
 
0 Kudos
Message 5 of 13
(3,638 Views)
Kineta,

Your device supports both DAQmx base and DAQmx. Dennis posted two great links. I have seen the first take care of many issues. He also asks many good questions, which will help us figure how to fix your error. If you are having trouble with LabVIEW, I would recommend our 3 & 6 hour online tutorials. KB 3ULFGEZA will be helpful in understanding what functionality the 6009 has, and also tell you where to locate examples for the 6009.
David L.
Systems Engineering
National Instruments
0 Kudos
Message 6 of 13
(3,620 Views)
Thank you for all of your useful links.

For the first link, I can see my USB-6009 in MAX.  However, I was unaware that I needed to choose which driver it should be operating on.  Following that link, I found that I have both DAQmx and DAQmx Base drivers installed for the device, and that right now it is running DAQmx.

The last link was also very useful in sorting through all the examples on the find examples page.  I opened the one it recommended (Gen Mult Volt Updates-SW Timed.vi), and I'd thought I'd hit the jackpot ... except I'm having a few problems with it now.

1) I followed the instructions in the example finder.  Chose my channel(USB-6009/ao0), changed my min and max values to 0 to 5V, left the loop cycle as it was, and hit run... and I'm getting the error:  Error -200561 occurred at DAQmx Write (Analog DBL 1Chan 1Samp).vi.   It says the data it's getting is -62.8e-3.  Which means it's getting no data, right?  So... is there something wrong with the example?

2) I'm trying to understand where the 1000 samples, 5 cycles and 2 V amplitude come from on the block diagram.  I can see where the 1000 samples comes from, and I'm guessing the 5 cycles comes from the Quotient and Remainder tool.  However, where does it set it to 2 V ??  It says it does in "Step 2" ... but those boxes are zeros, and even if I change the numbers, nothing happens.

I understand the general idea of the example:  my device only allows on demand, so i can't use autostart and have to use a while loop for continuous generation, and make it software timed.  But I'm stuck at these two points now.

Thank you so much for helping me out!  Please, bear with me just a little longer Smiley Happy
0 Kudos
Message 7 of 13
(3,618 Views)
Hi Kineta,

could you add the VI you are using?

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 8 of 13
(3,614 Views)
This is the example straight off the example finder.  I just changed the physical channel to my ao0 and the range to 0-5V.

Thanks!
0 Kudos
Message 9 of 13
(3,612 Views)
Hi Kineta,

first issue #2, the data itself. The example contains a default array of 1000 elements containing 5 sinewaves with an amplitude of 2 V. To verify this, copy the constant to a new block diagram and plot it with a graph.

issue #1, the error. You set the range to 0-5 V, now the data is -2 - +2 V. hence the error. You could 2 to the array (do it before the while loop and feed the array to the upper terminal of the addition) and the error will be gone and you'll be outputting a sinewave between 0 and 4 V

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 10 of 13
(3,606 Views)