LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

6008 DAQ digital input

I am using the NI USB-6008 DAQ device. I need to have digital pins 2 and 3 each send out 5V. I have one executable that sends out 5V from pin 2 and another executable that sends out 5V from pin 3. However, when I run both executables at the same time, each pin only outputs 2.5V. Could someone please explain me why this is occurring? Thanks
0 Kudos
Message 1 of 9
(3,840 Views)
Hi Primesh-

Can you tell me more about how you're controlling the outputs and how you're measuring their voltage levels?

In testing with my USB-600x, I have seen that the levels are maintained at ~5V outputs for logic high regardless of how many outputs I am driving. If you have access to LabVIEW, the USB-600x Interactive Control VI can be very helpful. This is found under Start>Programs>National Instruments>DAQmx Base>Examples>LabVIEW 7.1.

I have looped the digital outputs to available input pins and measured the levels using the USB-600x itself and have seen good results. Please let me know if you are still having problems.

Tom W
National Instruments
Tom W
National Instruments
Message 2 of 9
(3,819 Views)
ModelA.vi is coded so that when a user turns a switch, pin 0 of the digital I/O port is turned on/off. ModelB.vi is coded the same way except that when the user moves the switch, pin 1 of the digital I/O port is turned on/off. When each program is executed separately, the corresponding pin outputs 5V. However, if I run both programs simultaneously, the maximum output voltage it sends is 2.5V. I tried to look at some mxbase examples of interfacing with the 6008, but I still cannot get both pins to output 5V at the same time. I've attached both modelA and modelB vi(s) to this post. Can you please inform me of what I am doing wrong? Thanks
0 Kudos
Message 3 of 9
(3,813 Views)
Hi Primesh-

I couldn't find the VIs you mentioned in the zip file you posted. The "Untitled1.vi" gives me an idea of what you're trying to do though.

You will not be able to run separate VIs to output to the lines in the port because the DAQmx Base Write VI writes only in hexadecimal port format. In other words, when you try to write to two different lines you are actually writing to the port twice.

Your best bet would be to write to the port as shown in the Write Dig Port.vi example in C:\Program Files\National Instruments\LabVIEW 7.1\examples\daqmxbase\Dynamic\dio on your local hard drive.

Please let me know if you're still seeing the voltage output level problem when running this example. If so, please let me know how you're measuring the voltage and what you are sourcing when the outputs are high.

Regards,
Tom W
National Instruments
Message 4 of 9
(3,803 Views)
Primesh, Tom,

If each VI is writing about an equal amount of time, I suspect that the 2.5 volts is the average of a square wave with a 5 V amplitude.

Lynn
Message 5 of 9
(3,797 Views)
Lynn-

This is an interesting thought and may be the root of the problem. This makes it even more interesting to see how Primesh is measuring the output levels.

Digital output in DAQmx Base is sort of unclear in indicating that the entire port is written with each operation, so if you were writing 0b00000001 and 0b00000010 in succession then the two outputs would appear as quasi-square waves. This idea reinforces the concept that it is important to only write to the device from one app at a time.

Thanks for your input Lynn!

Regards,
Tom W
National Instruments
Message 6 of 9
(3,794 Views)
I appreciate your help Tom and Lynn. It is my understanding that there is no way of running two executables at the same time with both programs communicating with the device. Is it possible that I could buy another 6008 USB DAQ and try to connect both devices to an external USB hub? Would this take care of the problem that I am facing? If so, how can you address the USB ports of the hub within LabVIEW?
0 Kudos
Message 7 of 9
(3,778 Views)
I appreciate your help Tom and Lynn. It is my understanding that there is no way of running two executables at the same time with both programs communicating with the device. Is it possible that I could buy another 6008 USB DAQ and try to connect both devices to an external USB hub? Would this take care of the problem that I am facing? If so, how can you address the USB ports of the hub within LabVIEW?
0 Kudos
Message 8 of 9
(3,780 Views)
Hi Primesh-

If you want to use two devices, the only identification you need to use in LabVIEW is to modify the device numbers as enumerated in the DAQmx Base Configuration Utility. The USB hub would appear transparent to LabVIEW- only the device numbers are needed for identification.

It is also possible to write to the lines with the same application as mentioned before. I have attached a DAQmx Base example with slight modification- the front panel switches assert or deassert port 1 lines 0 and 1. Please let me know if this is of help to you.

Thanks,
Tom W
National Instruments
0 Kudos
Message 9 of 9
(3,748 Views)