Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

A digital Line configured as Input can be set High

Configure a digital line as Output and set that line Low. Change that line's configuration to Input. If that line is now told to go High, it will (I would think it should not be able to be changed). But it cannot be set Low again.

If the line were High when it was configured back to Input, it will not change low if told to.

PCI-MIO-16E-4 using ComponentWorks V6 and Delphi 6
using CWAI1.LineDirection and CWAI1.SingleWrite
0 Kudos
Message 1 of 3
(3,414 Views)
Actually, all of your digital lines on that board are pulled high when in the input state. This is also the default state of the board. I'm willing to bet that it's not the .SingleWrite() method that is changing the state to high. Rather, as soon as you call the .LineDirection() method setting it to input, the line will be set high.

Let me know if you are sure this isn't the case.

Russell
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 3
(3,414 Views)
Russell,

This is not the case. The digital line's state does not change when .LineDirection() method is called to set the line as Input. It remains Low. Rather, it only changes after .SingleWrite() method is called. I tested this by having four buttons each with an OnClick event handler performing only one task:

#1: CWDIO1.LineDirection := 0;
#2: CWDIO1.LineDirection := 1;
#3: CWDIO1.SingleWrite(0);
#4: CWDIO1.SingleWrite(1);

Sequence of tasks was #2 to set line as an output, #3 to set line Low, #1 to set line as an input (bit stayed low), #4 to attempt to set bit high - it should not be able to be changed since line is now an input but it did change High.

I tried to duplicate this with LabVIEW using DIO Port Config.vi and DIO Port Write.vi
and it looks like the bit does get set high when the line is changed back to an input as you expected it to.

Steve
0 Kudos
Message 3 of 3
(3,414 Views)