Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DIG_Prt_Status always returns 4 when port A is configured for bidirectional handshaking

When I configure port A on a LABPC-1200 to be bi-directional and try to use DIG_Prt_Status to check whether I can write to the output latch it always indicates the latch is empty by returning a 4. If I write to port A, OBFA goes active, DIG_Prt_Status still returns a 4. If I use REG_Level_Read on port C at this point it port C show OBFA is active. What gives?
I am going to use REG_Level_Read to get around this, but it's in the obsolete section of the header file and I'm afraid it will disappear leaving me with no way to handle this situation.
0 Kudos
Message 1 of 3
(3,241 Views)
kflynn,

The following two Knowledge Bases should explain what you are seeing. Especially take note of the last paragraph of the first KB:

http://digital.ni.com/public.nsf/websearch/F865C1157622C9DE8625648B00782CDA?OpenDocument

http://digital.ni.com/public.nsf/websearch/92582BD25EE97F8D85256442005968C9?OpenDocument

Ames
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(3,241 Views)
If I set PORT A of a LabPC to OUTPUT and HANDSHAKING then call DIG_Prt_Status I will get a 1 in the handshakeStatus variable indicating that it is safe to write to port A. If I then write to port A and repeat the call to DIG_Prt_Status I will get a 0 in the handshakeStatus variable indicating that the data has not been ACK'ed and therfore it is not safe to write to port A.

If I set PORT A of a LabPC to INPUT and HANDSHAKING then call DIG_Prt_Status I will get a 0 in the handshakeStatus variable indicating that no dat has been STB'ed in.

On the other hand if I change the setting to BIDIRECTIONAL and HANDSHAKING, DIG_Prt_Status will return a 4 no matter what the state of the port is.
I have to use REG_Level_Read to get the value of port C and test the
OBFA and IBFA bits to check the status of port A. My only worry is that REG_Level_Read and _Write are listed in the obsolete section of the header file and may disappear on me.
0 Kudos
Message 3 of 3
(3,241 Views)