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

下载
页码 19
© National Instruments Corporation
15
Using PCI Serial with Linux
linux# ./rs485 <
transmit port number> 0
linux# ./rs485 <
receive port number> 0
linux# ./serialtest <
receive port number> <transmit port 
number> 
What do I do if my ports are not communicating correctly and print 
strange characters?
Make sure the baud rate, character size, clock speed (if PCI-485) and parity 
are the same for both the receiver and transmitter. Also make sure the 
transceiver modes (PCI-485) have been selected for both transceivers. 
How can I use 
/dev/ttyS0
/dev/ttyS1
/dev/ttyS2
, or 
/dev/ttyS3
 as National Instruments serial ports?
Check for available serial devices by entering the following:
linux#
setserial -gv /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 
Devices labeled with 
UART: unknown
 are available for use. To designate 
the available device when using 
setserial
, enter the following:
linux#
setserial /dev/ttyS<
port number> uart 16550a 
port 0x<
port address> irq <irq> ^fourport
Assign Driver
Use these instructions to automatically assign the driver at startup using 
/etc/rc.d/rc.serial
.
You should not change the 
/etc/rc.d/rc.serial
 file until you have 
your serial interfaces installed and configured. If you add another device or 
interface to your computer, and your 
lspci
 output changes, make sure you 
also change 
/etc/rc.d/rc.serial
.
Depending on your Linux distribution, you might not have an 
/etc/rc.d/
 
directory. In this case, your 
rc.serial
 would be located under 
/etc/rc.serial
. If you do not have 
/etc/rc.d/
, replace the references 
to 
/etc/rc.d/
 with 
/etc/
. If you are using a Debian distribution, replace 
the references to 
/etc/rc.d/rc.serial
 with 
/etc/rc.boot/0setserial