From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-15-2011 12:40 PM
I have a USB-6008, I have to read an input on the DIO.
I want it to report 1 When the line has a 5v present, and 0 for anything else.
When I have nothing on the lines. It reads 1's
how do I configure this to read 0 When nothing is connected?
Also how would I configure this in c#
Thanks
Solved! Go to Solution.
04-18-2011 05:38 PM
It should be using TTL logic levels to determine a 1 or a 0. If it's between 0-0.8V it should read a "0" and if it's between 2.0-5V it should read a "1." Is this not the case with your device? Did you call any functions that reverse the logic levels?
04-18-2011 05:59 PM
Hello ashitakaLax,
The USB-6008 has an internal pull-up resistor to 5V (per page 22 of the User Guide and Specifications) which is pulling the line to 5V whenever nothing is connected.
In order to change this, you can add an external pull-down resistor to pull the output to ground when disconnected, though your device will need to source more current to drive the line high.
Regards,
04-20-2011 07:04 AM
Based on your original post, you are looking for the presence of 5 volts. Anything else would be considered "not there". If you are truly looking for just 5 volts (4.9 volts considered "not there") then use the analog input and just measure the voltage. If you are actually looking for "1" and "0" logic levels, then the pull-down resistor should help. You may want to also re-evaluate how the external stimulus is being created. For most digital signals, one the line is disconnected, they are pulled high and the external stimulus pulls them low to activate.
01-10-2013 03:56 AM
Hello, I have exactly the same situation. Is there a recommended value for the pull down ? I guess it should be something like 1 KOhm to be sure to keep it below 1-1.5V when floating, and thus it will require 5mA when I use it as DO. This means that only 3.5 mA are left to drive my external device. Am I right ?
Thanks a lot
Paolo
01-10-2013 06:15 AM
You only need the pull-down when the line is an input. If you are using the line as an output, do no put in a pull-down.
Another alternative is to use a buffer to allow for more current to your device.
01-10-2013 06:38 AM
HI, thanks for the quick reply ! I know that as output I don't need a pull-down. The problem is that from the power on to the moment in which my application configures the port as output there can be an unpredictable time interval. During this interval the line will be as default a high impedance input and if it floats to high values it can trigger wrong behaviors in the device that I'm controlling. That's why I need a pull down, to be sure that the line is down until I force it to be an output. I will try with values around 2K Ohm and see what happens
Regards
01-10-2013 09:28 AM
You can determine the pull down resistor. At start up you have the internal pull up resistor, the input impedance of any external devices connected to the line, and the pull down resistor you need to add. Calculate the value of the pull down resistor needed to assure that the output voltage is less than the Vih specification of your external device. Then calculate the total current sourced by the DO line when it is an output and set high. If that current exceeds the maximum source current of the USB-6008, then you need a buffer circuit. If it is within the specification, install the resistor.
A more robust method is to insert a circuit between the DAQ device DIO lines and the critical external devices which requires a series of high, low, high, low pulses before passing the data through. With this kind of circuit, you can require not only that the device has been configured as an output, but also that the software driving the outputs is active and has sent the specified control sequence indicating that it is control.
Lynn