National Instruments PCI-232/2 Isolated 用户手册

下载
页码 19
Using PCI Serial with Linux
10
www.natinst.com
Configure PCI-485
If you are using a PCI-485 interface, you can select the transceiver 
mode for each device and select the lower baud rates listed in 
termios_program.c
 provided in your 
PCI-SERIAL
 directory. 
Select Transceiver Mode
Use the 
rs485
 program (from the 
PCI-SERIAL
 directory) to select the 
transceiver mode. 
rs485
 sets the transceiver mode for only one serial port. 
To set the transceiver mode for other serial ports, rerun 
rs485
 with a 
different serial port number specified in the command line. For more 
information on the transceiver control modes, refer to your serial getting 
started manual. If you do not know which transceiver mode to use, choose 
Four-Wire Mode. 
Enter the following to use 
rs485
:
linux PCI-SERIAL# ./rs485 <
port number> <mode>
rs485 Example
Enter the following to select Four-Wire Mode for 
/dev/ttyS5
:
linux PCI-SERIAL# ./rs485 5 0
Lower Baud Rate Selection
To use a baud rate lower than 200, use 
setserial
 and the 
clockspeed
 
program (from the 
PCI-SERIAL
 directory) to lower the baud base of a 
single serial port from 460800 to 115200. After changing the baud base 
to 115200, the max baud rate you can achieve is 115200 baud (until you 
change the baud base back to 460800).
After you change the 
baud_base
 of the serial port using 
setserial
 and 
run the 
clockspeed
 program, you can use the lower baud rate flags in 
your programs. The 
clockspeed
 program changes the baud base of only 
Table 3.  Transceiver Mode Values
Transceiver Mode
Mode
Four-Wire Mode
0
Two-Wire Mode: DTR with echo
1
Two-Wire Mode: DTR controlled
2
Two-Wire Mode: TXRDY auto 
control
3