Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between input-output on bidirectional port of the 6503

I use port A of a PCI-6503 card as a bidirectional I/O port to communicate with another device. Hardware hanshake signals are controled on port C by the remote device, as specified in NI documentation. The problem is how to use Digital I/O VIs to manage both inputs and outputs on one bidirectional port ! No NI example do this.

I initialize the port as bidirectional using "Digital Group Config.vi" and specify external handshake signals using "Digital Clock Config.vi". I then create a buffer with "Digital Buffer Config.vi" (1).
Once the port and buffer have been set, it seems that the first next operation will decide wether bidirectional means "input" or "ouput":

* If I immediately "start" the buffer,
the DAQ layer assumes that a read operation is started. As a matter of fact, "Digital Buffer Read.vi" will provide any data received from the "listening" port.

* If I instead use the "Digital Buffer Write.vi" (eg. with void inputs to only report write op.status), the DAQ layer assumes that a write operation is started and expects the buffer to be started, read by the remote device, and stoped, and filled again, started, stoped, etc....

How do I switch to "input buffer" mode to "output buffer" mode using the same bidirectional port ?

oz


(1) Some of the NI ressources about bidirectional mode say buffers are not allowed. In fact, only onboard and DMA buffering are not allowed. Buffering at LabVIEW level (Digital I/O VIs) IS allowed ! NI ressources are quite confusing here.
0 Kudos
Message 1 of 2
(3,539 Views)
Hi oz,

The limitations you are seeing have to do with the fact that the NI-DAQ driver is not taking full advantage of bidirectional mode on the 8255 chips. You are correct that NI-DAQ (hence LabVIEW) can support buffered input and output with these chips but the driver does not have the capabilities to switch between input and output operations. This functionality hasn't been built into the driver.

Hence, you are limited to making static or single reads and writes to the input and output registers. So in essence, the resources you found on the web are correct for the particularities of bidirectional mode.

The following knowledge bases describe how to perform bidirectional operations using the device.

Understanding the Bi-Directional Mode of 8255
Chip
http://digital.ni.com/public.nsf/websearch/F865C1157622C9DE8625648B00782CDA?OpenDocument

How Do I Use Bidirectional Mode with an 8255 DIO Chip?
http://digital.ni.com/public.nsf/websearch/92582BD25EE97F8D85256442005968C9?OpenDocument

Hope that helps. Have a good day.

Ron
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(3,539 Views)