LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect connection between pins using digital I/O

I am working on a project in which the USB 6501 DAQ has wires connected from the left to the right side on random ports and I need to detect the connections correctly.  I am currently using the DAQmx VIs to turn on a digital output signal on the first pin and then reading the input from all of the other pins to see where the digital high is coming in.  I can successfully turn on a digital high signal on any given pin (confirmed using a multimeter).  The issue arises when I cannot read a digital high input on a pin when it is connected via a wire (no additional circuitry to complicate it) to a pin outputting a digital high signal.  Can somebody help me determine both if this is possible and if so, what might be doing wrong?

 

Thank you in advance for your assistance!

 

[ If my description above isn't clear, I have attached a diagram with further explanation that hopefully makes more sense ]

0 Kudos
Message 1 of 15
(3,521 Views)

The scenario you describe should be possible. However it will depend on your code. You will need to post an example VI.

 

Kind regards,

 

Rick

0 Kudos
Message 2 of 15
(3,451 Views)

I have attached two peices of code.  The "Read Digital Signal" VI is the one that seems to be the biggest issue here.  This VI should read all pins on both sides of the DAQ and return the boolean values (High or Low) on each pin and return it to the VI that calls it in the form of a boolean array.  It works most of the time when I trigger certian pins using a DC power source set to 5 volts, but it never works when I trigger any of the pins using the "Write Digital Signal" VI.  The "Write Digital Signal" VI should write the boolean value it takes as an input to the channel(s) it recieves as an input.  This peice of code seems to work fine (as I have checked its functionality with a multimeter on several occasions) but it will work very closely with the "Read Digital Signal" VI and it can't hurt to post it as well.

Download All
0 Kudos
Message 3 of 15
(3,438 Views)

Easilly doable.  but, you need to have some serious DAQmx Jedi training young padawan.

 

(Waves hand) These are the functions you are looking for...

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 15
(3,419 Views)

When you run the Write Digital Signal.vi it should configure the one line for an output. However, if you were to run the Read Digital Signal.vi after that it would turn the output back into an input. You would need to exclude that line from port.pin list.

 

I would imagine that the lines that do not have any input at all, i.e. they are floating, would read as a logic high. You would have to tie them to ground to get a defined state from them.

 

There is a USB-6501 Interactive Control Panel located here: http://digital.ni.com/public.nsf/allkb/AF0F31EE5D2AD23F862573140009D7C2 read the instructions carefully as you may need to install the "DAQmx Base" set of drivers in order to use it.

 

Kind regards,

 

Rick

 

0 Kudos
Message 5 of 15
(3,394 Views)

First, thank you very much for helping me with this!  Now, I am working on reconstructing the VI that you posted but I have a question.  What are the two blocks that I circled in red?  I am having trouble finding them in the functions menu.

 

 

Jeff's VI.png

0 Kudos
Message 6 of 15
(3,358 Views)

Hi,

 

Take a look here: http://www.ni.com/tutorial/9330/en/ to see about using snippets. That way you won' have to recreate the code manually.

 

Kind regards,

 

Rick

0 Kudos
Message 7 of 15
(3,345 Views)

Thanks for the tip Rick!  The only issue now is that the VI Jeff posted is LV2014 and I am currently running LV2012, is there any way I can back convert it?

0 Kudos
Message 8 of 15
(3,331 Views)

ptchrist wrote:

Jeff's VI.png


The function on the left is Delete From Array.  The function on the right is Replace Array Subset.  Both are in the Array palette.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 15
(3,323 Views)

As a beginner you're better off reproducing the code yourself rather than just using a snippet to copy someone else's work.  Those VIs have little grids in them which is the symbol for array functions.  Check the array palette.  If you want to take the easy way out there is a Version Conversion Board link at the top of the main forum page.  Smiley Wink

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 10 of 15
(3,319 Views)