Setting The Transceiver Mode With Deviceiocontrol; Table 4-2. Transceiver Mode Control Bytes; Table 4-3. Deviceiocontrol Function Input Values - National Instruments PCI-232/2 Getting Started

Table of Contents

Advertisement

Setting the Transceiver Mode with DeviceIoControl

© National Instruments Corporation

Table 4-2. Transceiver Mode Control Bytes

Transceiver Mode
Four-wire mode
Two-wire mode:
DTR
Two-wire mode:
DTR
Two-wire mode:
TXRDY
The scratch register is located at offset 7 from the base address of the port.
For example, if COM2 were located at base address 0x3F8, and you wanted
to set the PCI-485 board to two-wire mode with
write a 0x02 to I/O address 0x3FF. The PCI-485 board would immediately
switch to the two-wire mode with
The NI Serial software extends the Windows function
for programming the transceiver control mode. To program the transceiver
control mode using
DeviceIoControl
1.
Add the following lines to your source code.
#include <winioctl.h>
#define IOCTL_SERIAL_SET_TRANSCEIVER_MODE
CTL_CODE(FILE_DEVICE_SERIAL_PORT,37,METHOD_BUFFERED,
FILE_ANY_ACCESS)
2.
Use the Win32 function
code value listed in Step 1 to set the transceiver mode, and the input
buffer values (unsigned long) listed in Table 4-3 for programming
different transceiver modes.

Table 4-3. DeviceIoControl Function Input Values

Transceiver Mode
Four-wire mode
Two-wire mode:
DTR
Two-wire mode:
DTR
Two-wire mode:
TXRDY
Chapter 4
with echo
controlled
auto control
control.
DTR
, complete the following steps.
DeviceIoControl
with echo
controlled
auto control
4-3
Using Your Serial Hardware
Control Byte
0x00
0x01
0x02
0x03
control, you would
DTR
DeviceIoControl
. Use the defined control
DeviceIoControl
Function Input
Value
128
129
130
131
PCI Serial for Windows 95

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pci-232/4Pci-485/2Pci-485/4Pci-232/8

Table of Contents