Setting the RS-485 Programmatically Controlled Bias
Resistors with DeviceIoControl
The NI-Serial software uses programmatic control codes and the
DeviceIoControl Windows function for programming the RS-485 bias
resistor mode. To set and retrieve the RS-485 bias resistor mode,
complete the following steps:
1. Add the following lines to your source code:
#include <winioctl.h>
#include <NiSerial.h>
Note
The header file
NiSerial.h
is included on your NI-
Serial software CD. You also can find it in the
NI-Serial
folder where you installed your National Instruments
software (typically,
C:\Program Files\National Instruments\NI-
Serial
).
2. The
SERIAL_RS485_BIAS
attribute can have the following values:
RS485_BIAS_OFF
RS485_BIAS_ON
3. To set the RS-485 bias resistor mode, use
NISERIAL_SET_RS485_BIAS
and DeviceIoControl. For example,
to enable programmatically controlled RS-485 bias resistors, use
the following code:
SERIAL_RS485_BIAS l_SerialRs485Bias = RS485_BIAS_ON;
DWORD l_ByteCount;
DeviceIoControl (
PortHandle,
NISERIAL_SET_RS485_BIAS,
(LPVOID) &l_SerialRs485Bias,
sizeof (l_SerialRs485Bias),
(LPVOID) NULL,
0,
Summary of Contents for PCI-8430
Page 1: ......
Page 5: ...Using Help Conventions Navigating Help Searching Help Printing Help File Topics...
Page 21: ...Serial Hardware Overview PCI Kits PXI Kits USB Kits ENET Kits ExpressCard Kits PCMCIA Kits...
Page 24: ...PCI 485I RS 485 two port isolated RS 485 four port isolated...
Page 27: ...PXI 8423 RS 485 two port isolated RS 485 four port isolated...
Page 63: ...Save Pending Changes To save your changes to this item click Save...
Page 98: ...0 LPVOID l_SerialInterface sizeof l_SerialInterface LPDWORD l_ByteCount NULL...
Page 127: ...2 PORT LEDs USB Serial Hardware LEDs...
Page 139: ...Connecting the Cables to a Four Port PXI Serial Board...
Page 141: ...67 58 50 41 33 24 16 7 TXD 9 RI 9...
Page 167: ......
Page 169: ......
Page 171: ......
Page 181: ...How many serial ports can I have on my machine You can have up to 256 serial ports...
Page 201: ...Glossary Prefixes Symbols A B C D E F G H I K L M P R S T U V...
Page 203: ...Symbols degrees ohms percent...
Page 204: ...A A amperes ANSI American National Standards Institute...
Page 205: ...B b bits B bytes baud bits per second bps bits per second...
Page 208: ...E EIA Electronic Industries Association EMI electromagnetic interference ENET Ethernet...
Page 209: ...F FCC Federal Communications Commission FIFO First In First Out ft feet...
Page 210: ...G G ground...
Page 211: ...H HSI handshake input HSO handshake output Hz Hertz...
Page 213: ...K Kbaud kilobits per second...
Page 214: ...L LED light emitting diode...
Page 215: ...M m meters MB megabyte...
Page 216: ...P PC personal computer PCI Peripheral Components Interconnect...
Page 218: ...S s seconds SCSI Small Computer Systems Interface...
Page 220: ...U UART Universal Asynchronous Receiver Transmitter...
Page 221: ...V V volts VDC volts direct current VXI VME eXtensions for Instrumentation...