Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

HSDIO-6541 Initial State

Hi,
 
I'd like to set the initial state of HSDIO-6541 channel as HIGH, even after the instrument handle is closed.
 
I tried "Configure Initial State" before Generation and "Configure Idle State" after Generation. But it looks like the state goes back to Low after I closed the instrument handle.
 
Could any experts help me on this?
 
Thanks a lot,
Jing
0 Kudos
Message 1 of 5
(3,626 Views)
Hello Jing,

As described in the NI Digital Waveform Generator/Analyzer Help:

"The Initial state configures the state of the data generation channels after a session has been configured but before the device starts generating the waveform. The Initial state is often useful while the device is waiting for a Start trigger.

The Idle state configures the state of the data generation channels after the waveform generation has begun and the generation has paused or stopped."

The Idle and Initial states are only valid when the NI-HSDIO driver session is open because the state of the channel is not controlled by the driver after the session is closed. Rather than using a programmatic solution, I think you should consider using hardware to control the state of the line. If you would like the line to remain high when not in use, you could add an external pull-up resistor. This concept is discussed in greater detail in a tutorial online here. However, you need to consider the channel electronics of the device when selecting the appropriate value for the pull-up resistor. For example, the section called "Channel Electronics" in the NI Digital Waveform Generator/Analyzer Help, shows that the NI 6541 has an internal 10 kOhm pull-down resistor on each of the DIO channels. You also need to consider the logic level that you are trying to maintain when selecting this value. Different pull-up resistors will change the voltage level on the channel, and you need to be sure that the level still works with your application.

For your reference, the NI Digital Waveform Generator/Analyzer Help can be found by navigating to Start>>All Programs>>National Instruments>>NI-HSDIO>>Documentation.



Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 2 of 5
(3,596 Views)


@jcao wrote:
Hi,
 
I'd like to set the initial state of HSDIO-6541 channel as HIGH, even after the instrument handle is closed.
 
I tried "Configure Initial State" before Generation and "Configure Idle State" after Generation. But it looks like the state goes back to Low after I closed the instrument handle.
 
Could any experts help me on this?
 
Thanks a lot,
Jing


Hi Jing,

One thing that you could do is to write a static high value right before closing the instrument handle: Move the data lines from dynamic to static and then write the high value.

Hope this helps,

Jeff
0 Kudos
Message 3 of 5
(3,595 Views)
Hello Jing,

I just wanted to post back and clarify my earlier comments. Following up on what Jeff said, the NI 6541 will hold the last value written to the line even after the session has closed. So, if you want to ensure that the line is high after you have closed your session, you would just need to ensure that the last value written to the line is high. The device continues to hold the last written value until a new value is written or the device loses power. The overall model of the channel state will be as follows:

1. As stated in the Specifications for the NI PXI/PCI-6541/6542 here, the device powers up into a high-impedance input state.
2. When you open a session, you control the state of the lines through static or dynamic generation.
3. When you close the session, the last value written to the line is held until power is lost or you write a new value.



Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 4 of 5
(3,580 Views)

Hi Matt and Jeff,

Thank you so much for your help. I can set the initial state and the idle state now using the function you mentioned.

Thanks a lot!

Jing

0 Kudos
Message 5 of 5
(3,544 Views)