LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Not Outputting DAQ Signal

Solved!
Go to solution

I'm working on a project which requires two different waveform outputs to two separate channels. It also includes a trigger for a computer which has a camera hooked up to it. I was provided a VI that someone previously had used for a similar project and had to learn LabVIEW "language" for the first time. Unfortunately it doesn't seem to be outputting any signal through the DAQ channels. I've combed over the VI looking for anything suspiciously wrong to no avail; everything seems like it should work but it simply doesn't. I used a simple waveform generator provided with LabVIEW to generate a sine wave and it did output to my oscilloscope for both channels. I also tested all the hardware to make sure the VI was at fault. Could someone please help me figure this problem out? It would be much appreciated.

Download All
0 Kudos
Message 1 of 17
(4,251 Views)

Hi tenub-

 

     This VI uses the Traditional DAQ (legacy) driver.  This has been replaced by NI-DAQmx.  You may not get a whole lot of help on these forums as this driver is old.

 

     Is LabVIEW generating any errors or are you just not seeing an output?  What hardware are you using?  You can utilize the Context Help document in LabVIEW to help determine what each VI is/does and its required inputs and expected outputs.  To use this tool, click CTRL-H and then place your mouse over any VI you want to know more about.  You will see that information will populate in the Context Help window that pops up.

 

     I highly encourage you to migrate to NI-DAQmx.  Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW is a great document that will assist in this effort.

 

     Best of luck with your application!

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 17
(4,210 Views)

That code you inherited looks bad. I suggest you to rewrite it from scratch.

The first thin to avoid: the stacked sequence (those 4 frames). Everything should be controlled via data flow, that means the wires. You see an error wire in the first frame that's never used. This could go into the error input of the SubVis in frame 2. And again from frame two in the error wires of the VIs in frame 3 and 4. Just to make it clear, don't use the frames, just the code in them (or even better replace it with your own code and using DAQmx).

 

Another question, what version are you using? Looks like LV 5, but not younger than 7.1. You need to search which DAQmx drivers still support this version of LV.

 

Felix

0 Kudos
Message 3 of 17
(4,199 Views)

I'm just using a very old HP oscilloscope which works just fine to detect output. A BNC-2090 is connected to a card within the computer using traditional BNC cables. I'm not able to access the computer today to determine what exact PCI card is used to connect the 2090 to the computer but I can provide the information if needed. Once everything is working, the BNC cables will be connected to two scanning mirrors. Currently, I see no errors being generated and there is just simply no output.

 

The computer I was provided uses LabVIEW 6i. I can talk to my supervisor about getting a newer version of LabVIEW if necessary, but I feel my issue could be solved without upgrading. I can try to rewrite the code as suggested and see if that works.

 

Thank you both for the support thus far!

0 Kudos
Message 4 of 17
(4,173 Views)

About upgrading. What is recommended is to use DAQmx instead of DAQ. The DAQmx VIs are designed much better, so it should be easier for you to work with them.

What I mentioned is, that you can't blindly look for the latest DAQmx drivers, 'cause this won't support 6i any more. So you need to search (google: "DAQmx LabVIEW 6i site:ni.cm").

 

One more issue on the code: The while loop is missing a wait -> it runs at 100% CPU usage.

 

Felix

0 Kudos
Message 5 of 17
(4,141 Views)

Okay so I rewrote everything and the functions generate fine to the graph on the control screen. I'm just not exactly sure how to correctly output the two waveforms to my two channels along with sending a pulse train to the computer that will have the camera because I'm new at this. Basically it's a DAQ->DAQmx conversion issue. Here are my files I'm using:

0 Kudos
Message 6 of 17
(4,018 Views)

Here are some screenshots if you can't open the VIs (they were made with LabVIEW 2009 and using DAQmx 9.2.2):

 

vi_top is the trig function vi and vi_bot is the step function vi.

Download All
0 Kudos
Message 7 of 17
(4,017 Views)

Hi tenub-

 

     The best thing to do would be to look at our example finder.  In LabVIEW, click on Help»Find Examples.  Once the Example Finder opens, select Hardware Input and Output»DAQmx»Analog Generation»Voltage.  This folder contains all kinds of analog output examples that you can use to output your voltage.  Similarly, if you go to Hardware Input and Output»DAQmx»Digital Generation or Generating Digital Pulses, you will find digital examples.

 

     I hope this helps you find what you are looking for.  The biggest thing I see wrong with your vi.vi is you are trying to do both digital output and analog output with one line of code.  You will need to use two.  I hope this helps.  Have a great day!

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 17
(3,981 Views)

I did miss your posting of the 'reworked' code (sorry about that). So here my comments: still looks horrible! Please don't feel discouraged by this comment and keep posting. It's clearly not your fault, but you start learning LV with a bad piece of code and if you learn from this, you'd become a miserable LV-programmer. If you learn how to see the bad things and fix them, you become a good one. Smiley Wink

 

Major issues:

* DAQ code: you configure a task as a counter and then configure it as analog output. Doesn't make sense to me. I'm pretty sure this throws an error. Can you describe what the code should do? There might be ready made examples on ni.com for this kind of task.

* DAQ code - error handling 1: Use a shift register for the error cluster at the while loop. You might drop some errors occuring inside the while loop iteration.

* DAQ code - error handling 2: At the while loop, stop if the stop button is pressed OR if an error occured.

* The inherited logic to create the output signal looks rube ('rube goldberg', code that can be expressed much simplier) to me. Can you specify what it should do?

 

Others:

* Use clusters: Related controls should be placed inside a cluster (use type def's for this is good to propagate changes).

* Icon view: It's the LV default, but better do not use the Icon view for terminals. You can change it via right-click. There is also an Option that they are dopped as terminals by default.

* Array indexing: If you do not wire the index array function 'index`, it defaults to 0 (and subsequently 1.. if you resize it).

* Coercion dots: you see the red dots on several functions/nodes. This is because a type cast is performed (e.g. from I32 to DBL). Try to minimize these.

 

I hope this helps you with improving the code.

 

Felix

0 Kudos
Message 9 of 17
(3,960 Views)

"* DAQ code: you configure a task as a counter and then configure it as analog output. Doesn't make sense to me. I'm pretty sure this throws an error. Can you describe what the code should do? There might be ready made examples on ni.com for this kind of task."

 

I need to output each waveform to two DAQ channels to move two scanning mirrors while sending a pulse train to another computer in order to take images. That's really all the code should be doing.

0 Kudos
Message 10 of 17
(3,953 Views)