Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting digital outputs to digital inputs on the DAQ6508

I have created a wrap cable that wraps input ports to output ports on the DAQ6508. I am using LabWindows CVI to write the software, and I am configuring each port to be an input/output using the DIG_Prt_Config function. I am then writing to/reading from the lines using the DIG_In_Line and DIG_Out_Line functions. When I write to an output, the status comes back as a 0 (which is equivalent to Pass), and when I read from the corresponding input, I also receive a status of 0. But when I compare the value I wrote to the output with that read from the input, they are not the same. Does anyone know what I could be doing wrong? The DAQ card is recognized by Measurement and Automation Explorer, and I can successfu
lly test all of the I/O lines from there, so I know that it is not a problem with the card.
0 Kudos
Message 1 of 4
(3,700 Views)
Hello KJVSharp,

So when you say you can successfully test all the I/O lines from MAX, do you mean that you can verify that your input port is indeed reading the logic levels you've wired to the input and the output port is definitely producing the voltage levels you write to it?

If this is true, then I would suspect the cable. The cable just might be misrouting some of your connections. If you have access to a terminal block, you could wire and check the lines one by one. Another possible error could be that the port you're referring to in the code is different from the one you're wired to. Just a thought.

-Russell
0 Kudos
Message 2 of 4
(3,700 Views)
Hi Russell,

Thanks so much for your quick reply! When I said that I can test all of the I/O lines from MAX, what I was doing was just writing out to the lines of each port individually and then reading back the values of those same lines. I didn't have any wires that connected outputs to inputs. I assumed that if I could read back the correct logic levels from the lines after I wrote to them that I was writing out to the ports correctly. However, I then tried writing to the output lines and reading back the values from those same lines in my software, and I am reading in the correct values. I was pretty sure that the 6508 performed immediate I/O when a mode of 0 was used. Am I correct in that assumption... or do I have to strobe the lines before those values will show up on the input ports? I am in the process of having the cabling checked out now in case this is just an issue with the cable as you suggested... the DAQ card is connected to an ITA, so both the wrap cable and the ITA will need to be checked out.

The other thing I was wondering is whether or not this problem could be caused by some hardware configuration that I'm neglecting. I have read through the user's manual for the 6508, and I saw that pullup/pulldown resistors are required if you want to power up the device with its outputs in a known state. For my application, it really doesn't matter what the initial state of the outputs are. Do I need to have pullup/pulldown resistors on each of the lines anyway just to allow me to set the logic levels of the lines through software? Currently I don't have those. I'm sorry for these basic questions. My expertise lies much more heavily with software than with hardware... although I'm trying to change that! 🙂

Does it matter for my purposes whether the switch is set to power up the lines at a logic high, a logic low, or a floating state? I can't see that it would... but I am trying to explore all possible options.

Your suggestion about the port I'm referring to in the code being different than the one I'm wired to was a really good thought, but that was the first thing I checked when I saw that the values weren't correct and that doesn't appear to be the problem.

I don't know if this makes a difference or not... but I am always writing a 1 to my output lines, but all of my input ports always read logic levels of 0. For some reason, I was able to correctly read 1's off of only one of my input lines twice... and I haven't been able to do it since. I'm not sure why, because the wiring should all be the same.

I'm leaning towards your idea that the cable is just wrapping the wrong signals... but the cable is wrapping signals for both the DAQ card and another card... and all of the signals for the other card are wrapping fine. It would be pretty strange for the technicians to have wired the part of the cable wrapping the other signals completely correctly but the DAQ signals completely wrong... but I'm really not sure if there's another possiblity.

Sorry for such a long note... I hope this helps you better see where I'm coming from though! If there's anything that I didn't make clear enough, please just let me know. Thanks so much for your help!

KJVSharp
0 Kudos
Message 3 of 4
(3,700 Views)
You're correct that when using the immediate mode, there is no clocking required. As soon as the software finishes the function call you should have your results. Also, I don't think the pullup/pulldown resistors should affect you either.

I did want to ask you about something though...

I don't know if this makes a difference or not... but I am always writing a 1 to my output lines, but all of my input ports always read logic levels of 0. For some reason, I was able to correctly read 1's off of only one of my input lines twice... and I haven't been able to do it since. I'm not sure why, because the wiring should all be the same.



What happens if you write all 0's to the output port? I'm wondering if the input port would re
ad all 1's in this case. If this is true, you might be getting these values inverted somewhere. I know that when you create a virtual channel you have the option to have the lines inverted or not. Are you using virtual channels. If so, perhaps this is something to check in it's properties settings. By the way, have you been using Traditional NI-DAQ or the new DAQmx API?

If after writing all 0's you instead still get all 0's on the input, then I would be very suspicious of the cable. If possible, you might get a terminal block and try wiring 5V to this input port to verify (just for sanity) that you can indeed read an externally applied voltage status on that port. If this works AND the cable turns out to be wired correctly, the cable still could be the problem if it is dividing down the voltage levels below the TTL threshold for a logic 1. Eventually, you may need to chase this down with a multimeter. (ie find out where 5V is and isn't.)

Don't worry, we'll get to the bot
tom of this. Let me know what you find out.

-Russell
0 Kudos
Message 4 of 4
(3,700 Views)