LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 Multiple Digital Outputs

Hi All,

I am currently using the NI 9401 to send different types of Digital Protocols to a unit under test and having trouble with changing through the 8 channels outputs. The tester is sending commands to 4 different UUT's and currently i can only send the Digital outputs via DIO 0. This means the signal is having to be multiplexed to the other Units which is time consuming.

I know i won't be able to send the digital singals to all 4 at the same time but is it possible to send it to 2 at the same time using DIO0:3 DIO4:7 becasue these are isolated?

I've attached my Code (2016 LabVIEW)

0 Kudos
Message 1 of 9
(4,488 Views)

Do you want to send a digital waveform (PWM etc) or simply toggle a digital output, timed by the software?

 

You are using the DAQmx Write to write a digital output. If this is what you want to do, simply use Digital >> Multiple Channels instead to be able to write to all channels simultaneously. But please note that in that case, most of your DAQmx code is redundant. Look at the examples.

0 Kudos
Message 2 of 9
(4,460 Views)

I want to toggle a digital output. The different Sub VI's I've created (0 and 1's) are different commands in a particular protocol.

 

Yeah the State machine is working at the moment but I'm switching everything on sequentially using a USB I/O and a multiplexer and this isn't great. I wrote a simple output command from Channel DIO 7 but it didn't seem to work. Do you know where I can find examples of code written for NI 9401?

Regards

Andrew

Message 3 of 9
(4,443 Views)

I see. You can still use Digital >> Multiple Channels to write to all channels at the same time! Just feed a 2D U8 instead.

 

Some other various pointers:

What is the purpose of the multiplexer, it does not seem to be necessary at all?

You only need to create and clear your task once and start task is not necessary.

You can wire the error cluster directly to the Or function.

 

0 Kudos
Message 4 of 9
(4,437 Views)

Hi Andrew,

 

I am slightly confused as to what exactly you want to do, but it seems like you are looking for a way to bundle multiple physical channels into a DAQmx task. You can do this by selecting the Browse option from the drop-down menu on the channel constant and selecting more than one channel. This will allow you to write to all channels with a single write function. To answer your questions about examples, one of the nice things about DAQmx is that it abstracts away much of the hardware detail. There is no need for examples written specifically for the 9401 because digital output channels appear to operate the same in DAQmx across all modules. The only significant things that will change across modules are the number of physical channels, the timing options, and the triggering options. The process of creating a task, specifying settings for that task, starting and writing to the task, and closing the task remains the same. For examples of these practices, check out the NI Example Finder.

 

Here is a great resource to help you learn a little more about DAQmx. I would try to move away from the DAQ Assistant as soon as you can. It doesn't give you anywhere near the versatility and control you get from the DAQmx functions, although it is easier to use.

 

If you have any additional questions, or I misunderstood your query, feel free to follow-up here!

 

Best,

 

Duncan W.

0 Kudos
Message 5 of 9
(4,434 Views)

I'm starting the think my DAQ device is faulty.

I've attached a simple VI and when selecting Output 0, i get the required output on the Oscilloscope (I've atteched the a picture). But when i select any other line and place the oscilloscope leads on the correct terminal O/P i get nothing.

The active LED on the cDAQ-9171 flashes so i think it must be the NI 9401.

Download All
0 Kudos
Message 6 of 9
(4,417 Views)

The instance of the DAQmx Write function that you are currently using is designed to write an 8-bit number to a port. If you are trying to write 1's and 0's, then you will only see output on the least significant bit, or line 0. Also, I do not know how you are selecting your lines to group into channels, but if you are selecting one at a time for testing and trying to write to that channel like it is a port, it is likely you are experiencing undefined behavior. Check out the other instances of the Write function and make sure you are using the correct one for your application. For example, if you would like to write the same protocol to each line within a channel, you should probably use the Digital 1D Bool 1Chan 1Samp instance.  If you could elaborate more on your application and goals, I think that would help us better understand what you are trying to do and help you construct a system for your application.

 

 

If you are convinced your device may be faulty, I would recommend giving NI support a call at 1 (866) 275-6964. However, I wouldn't be so quick to jump to that conclusion.

 

Duncan W.

 

 

0 Kudos
Message 7 of 9
(4,408 Views)

Thanks for the reply.

I've attached a picture of the four devices that need to be tested Isolated of each other. These devices will emit sound and light, so i need to send different protocols to them all (sound volume, sound tone, light/sound output etc).

I needed to test the devices sound output sequentially so i know if one was faulty using a microphone. So i thought i could send the different protocols down the same line and multiplex it to the different devices (the NI 9104 is switching a FET on a circuit which is steping the voltage upto 24V).

This did work, but i would like to write the first protocols setting the volume and tone to the UUT's at once to save time. Then i can send the Ouput commands seqentially to read the outputs independently of each other.

Also, i will be designing a tester to test these products at PCB level and more testing will be added so i need to try and get multiple outputs from the NI 9401 at once.

0 Kudos
Message 8 of 9
(4,396 Views)

I'm still confused as to how you are using the 9104 in your application. What do you mean by "multiplex it to the different devices"? Multiplexing involves selecting from multiple inputs. Do you actually mean you have built some kind of demux system?

 

What does "write the first protocols setting the volume and tone to the UUT's at once to save time" mean? I am assuming you would like to use each physical channel to send a different protocol to a different device. You can do this, but you will either need different tasks for each protocol, or you will need to conditionally write to certain channels within a task. Of these options, the former is probably a little easier.

 

If your question is just "how do I write different values to different channels on my 9401?", then look at this or set up different tasks for different sets of channels.

 

Duncan W.

0 Kudos
Message 9 of 9
(4,389 Views)