Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

Highlighted

Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

 How do I use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501
I am trying to set thre default power on state for all digital lines
 
DAQmxErrChk DAQmxSetDigitalPowerUpStates("Dev3", "Dev3/port0/line0:7", DAQmx_Val_Low, 8)
 
The above line of code Crashes VB6.0 SP5 VB shuts down as soon as I try to exicute this code
0 Kudos
Message 1 of 8
(7,231 Views)

Re: Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

Hi CUImsch,

The DAQmxSetDigitalPowerUpStates function takes four arguments: deviceName, channelNames, state, and "...".  The "..." indicates that you can include additional channelNames and state arguments. The final channelNames and state pair must be followed by a NULL argument. For example, to set port0 to a default low state use:

    DAQmxSetDigitalPowerUpStates("Dev3", "Dev3/port0/line0:7", DAQmx_Val_Low, NULL)

If you want to set multiple ports with the same function call, include their channelNames and state arguments after the first port's arguments and follow it with NULL to indicate that you're done listing channels.

    DAQmxSetDigitalPowerUpStates("Dev3", "Dev3/port0/line0:7", DAQmx_Val_Low, "Dev3/port1/line0:7", DAQmx_Val_Low, NULL)

The NI-DAQmx C Reference Help contains more information on this function. Specifically under the Help Contents: NI-DAQmx C Functions » System Configuration » DAQmxSetDigitalPowerUpStates.



I hope this helps! Let me know if there is anything else I can help with or clarify. Have a great day!

Message Edited by ryan_d on 09-24-2007 06:10 PM

Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 2 of 8
(7,216 Views)

Re: Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

I think I finally got the syntax correct but I got an error message that said the USB6501 did not support the command. Is that correct

 

If so how can I set the power on port values.

 

Charley

0 Kudos
Message 3 of 8
(7,209 Views)

Re: Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

DAQmxSetDigitalPowerUpStates("Dev3", "Dev3/port0/line0:7", DAQmx_Val_Low, 1)
I was unable to use NULL since this gave me an error  illegal use of comand

 

 

0 Kudos
Message 4 of 8
(7,208 Views)

Re: Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

Hi Charley,

Upon further investigation, it appears that the USB-6501 does not support programmable power-up states. The power-up state options can be found on page 8 under the title Power-On States of the USB-6501 user manual. This option is also mentioned a little more explicitly on the product page and is listed as Programmable Power-Up States under the Specifications Summary. Unfortunately this means that there is no way to programmably set the power-up state. It will always default all lines to be high-impedance inputs. The best alternative is to immediately configure your DIO tasks at the beginning of your application.

Let me know if there's anything else I can do for you. I'm here to help!



Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 5 of 8
(7,200 Views)

Re: Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

Slight hijack of the thread, but it's related.
 
Using LW/CVI, how would one set up a 6501 to go from input (default power-on state) to output with high-level outputs, without going through a low-level output first?
 
I have several bits controlling things (negative logic) and they need to be mutually exclusive.  I can't have them all going low at all.
 
Any pointers?
0 Kudos
Message 6 of 8
(7,169 Views)

Re: Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501

Hi John,

The power-on state for the USB-6501 will always default to high-impedance input. However, DAQmx devices make use of lazy line transitions. What this means is that once a task-based route has been created and released, it will remain in its current state. So as long as you don’t turn off or reset your 6501, its lines will remain in their most recent state. This means that you could disconnect your system from the 6501, run a task that sets all of the lines to high-level outputs, reconnect your system, and run your application.

Message Edited by ryan_d on 10-02-2007 06:55 PM

Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 7 of 8
(7,152 Views)

Re: Use DAQmxSetDigitalPowerUpStates In VB6 for USB-6501


@ryan_d wrote:
Hi John,

The power-on state for the USB-6501 will always default to high-impedance input. However, DAQmx devices make use of lazy line transitions. What this means is that once a task-based route has been created and released, it will remain in its current state. So as long as you don’t turn off or reset your 6501, its lines will remain in their most recent state. This means that you could disconnect your system from the 6501, run a task that sets all of the lines to high-level outputs, reconnect your system, and run your application.
 

Message Edited by ryan_d on 10-02-2007 06:55 PM


Ryan,

The two statements seem to be in conflict.  Once you disconnect the 6501 it turns off.  Can you please clarify?

Thanks,

Paul

0 Kudos
Message 8 of 8
(4,590 Views)