LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Return array of all available hardware digital outputs

Solved!
Go to solution

Hi, I am using one of the digital outputs on the USB-6008 to turn on/off a relay switch.  The problem is that the initialized state of all the outputs for this device is high when the device is first powered up.  So, I include in my code to set the digital line of the solenoid valve (saved in the config file) to low when the program first runs.  The real problem is that the first time the program runs on other computers, depending on installed hardware, the line may have a different name.

 

Is there a way to return an array of all the available digital output lines, so that I can set them all low when my program first runs?  One of these lines will be the one I actually want to set low.

 

Thanks,

Greg

v7.1
0 Kudos
Message 1 of 5
(3,514 Views)

Hi Greg, 

 

Would it be possible for you to upload your code to have a look?

 

It is possible to assign default values to controls if this would be of any help?

 

Michael

0 Kudos
Message 2 of 5
(3,495 Views)
Solution
Accepted by topic author gstanczak

Dig down into the DAQmx palletes to the nodes and constants to find a "System" node. Select the "DevNames".

 

WIre that arry to a For loop with a "Device" node and you can select the "Product Type" and/or "Product Number".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(3,490 Views)

The USB-6008 is a simple device. It does not have programmable power-up states. In fact it powers up with all DIO lines as inputs. You can read the inputs but it does not have the capability to read the state of outputs.  Here is the relevant section of the User Guide (page 21):

 

"The default configuration of the NI USB-6008/6009 DIO ports is open

collector, allowing 5 V operation, with an onboard 4.7 kΩ  pull-up resistor.

An external user-provided pull-up resistor can be added to increase the

source current drive up to a 8.5 mA limit per line as shown in Figure 15."

 

The 4.7 kΩ pull-up resistors are likely what is causing you to think they start out high.

 

If you need to use the USB-6008, you may need to add some external circuitry which will not energize the valves until the DO line has undergone a High to Low to High sequence.  The timing of digital I/O is controlled by software so make sure the external circuitry does not require high speeds.

 

Lynn

Message 4 of 5
(3,471 Views)

Lynn, it sounds like the external circuitry would be the final solution.  For now though, I will settle for the solenoid valve being in the incorrect state until the program starts up, at which point Ben's suggestions appears to set the outputs to the desired state, indenpendent of what computer the program is run on.  I get what you mean with the pull-up resistor making the output look high.  Thanks all, Greg

v7.1
0 Kudos
Message 5 of 5
(3,349 Views)