Smartio C168H/HS User’s Manual Universal 8 Port Serial Board May 1999 (6th Edition) The content of this manual is also available in CD-ROM and at Moxa Web Site. Moxa Technologies Co., Ltd. Tel: +866-2-8665-6373 Fax: +886-2-8665-6372 www.moxa.com support@moxa.com.
Smartio C168H/HS User’s Manual The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms of the agreements. Copyright Notice Copyright 1999 Moxa Technologies Co., Ltd. All rights reserved. Reproduction in any form without permission is prohibited. Trademarks MOXA is a registered trademark of Moxa Technologies Co., Ltd. All other trademarks or registered marks in this manual belong to their respective manufacturers.
MOXA Internet Services Customer’s satisfaction is always our number one concern. To ensure that customers get the full benefit of our services, Moxa Internet Services have been built for technical support, product inquiry, new driver update, user’s manual update, etc. The followings are the services we provide. E-mail for technical support address: support@moxa.com.tw FTP site for free driver update address: ftp.moxa.com or ftp.moxa.com.
About This Manual This manual is composed of six Chapters and one Appendix. This manual is written for installer, system administrator and software programmer. If you are a first-time installer and system administrator, we recommend you to go through the whole manual except Chapter 4. If you are a software programmer, you may refer to Chapter 4 “Serial Programming Tools”. If you need cable wiring information, please see Chapter “Connection Option (Opt8x) and Cable Wiring”.
Table of Contents Introduction ..................................................................... 1-1 Overview................................................................................................................ 1-1 Features................................................................................................................. 1-4 Check List .............................................................................................................. 1-5 Installation Guide............
Setting MOXA Ports to Terminal................................ ................................ .................. 3-35 Serial Programming Tools ................................................ 4-1 Windows NT and Windows 95/98 .......................................................................... 4-1 Installation................................ ................................ ................................ ..................... 4-1 PComm Programming Library ................................ .........
1 1 Introduction Overview Smartio - The Smart Multiport Async Solutions The term Smartio stands for smart multiport serial I/O solution. The Smartio C168 Series multiport boards offer 8 serial ports for connecting terminals, modems, printers, data acquisition equipment and any other serial devices to the PC/AT and its compatible systems.
Hardware Configuration Method JP1 Switch ON 1 2 3 4 Jumper ......... ......... Smartio Family New : set I/O address and IRQ via software Utility. Traditional Multipoort Board Traditional : set switch and and jumper manually for I/O address and IRQ. Instead of using traditional jumper or switch for IRQ and I/O address settings, hardware configuration of each port is easily set by DOS utility, Io-irq.
Introduction Surge Protection To prevent the boards from damage caused by lighting or high potential voltage, surge protection technology is introduced in some model to protect the board. Operating System Support The family is operational under most popular operating systems such as Windows NT, Windows 95/98, SCO UNIX/XENIX/OpenServer, DOS, Linux, QNX, FreeBSD, UNIX SVR4.2, However, MOXA device drivers for Windows NT, Windows 95/98, Linux, SCO UNIX/OpenServer, UNIX SVR4.
Features The Smartio C168 Series consist of members as follows, C168H C168HS v v v v v v v v v v 8 port RS-232 or RS-422, high speed 16550C or compatible UART 8 port RS-232 or RS-422, surge protection, 16550C or compatible UART Custom-designed ASIC, compact board size (half-size) No switch no jumper, easily configured by software Independent I/O address, IRQ setting for each of 8 serial ports 16 bit AT bus architecture, more IRQs supported Surge protection for RS-232 (C168HS) Isolation protection for RS-
Introduction Check List Upon unpacking the Smartio C168 Series package, you should find the following items in the package, v Smartio C168 Series 8-port high performance async board Device driver diskettes: l Windows NT and Windows 95/98¡Ñ 1 l DOS¡Ñ 1 l UNIX¡Ñ 1 C168H/HS User's Manual (This Manual) v PComm Lite diskette¡Ñ 1 v v You need also one of the following connection options: Opt8A/Opt8B/Opt8S v v RS-232 connection box with 8 DB25 female/male/female ports, respectively (surge protection for O
Opt8C/Opt8D v RS-232 octopus cable with 8 port male connectors, DB25 for Opt8C and DB9 for Opt8D (1 meter long). P1P2 P3 P4 Smartio C168 Series P5 P6 P7 P8 Opt8C/Opt8D Opt8F/Opt8Z v v v RS-422 connection box with 8 port female DB25 connectors (isolation protection for Opt8F). 1.5 meter DB62 to DB62 cable. 110V or 220V adapter.
Introduction Opt8J v v v RS-422/485 connection box with 8 port female DB25 connectors. 1.5 meter DB62 to DB62 cable. 110V or 220V adapter. Smartio C168 Series Rx Tx 1 2 3 4 5 6 7 8 Opt8J Opt8J is the RS-422/485 connection box with 8 port female DB25 connectors for MOXA 8 port boards, including the Smartio C168 Series. There are 8-DIP switches on the side of the Opt8J. Each switch controls the communication mode (RS-422 or RS-485) of each port, respectively.
RS-485 Mode The Opt8J supports only 2-wire RS-485 communication. Set the respective switch to ON position to use RS-485 interface. This means the port can transmit data only when RTS is asserted, and receive data only when RTS is not asserted (half-duplex). Refer to Chapter “Connection Option (Opt8x) and Cable Wiring” for RS-422/RS485 cable wiring. And also to Chapter “Serial Programming Tools” for Opt8J RS485 programming details.
2 2 Hardware Installation The installation of the Smartio C168 Series consists of hardware and software installation. The hardware installation is detailed in this chapter. The next chapter deals with the software installation for various operating systems.
Now you should do either the normal hardware installation (detailed in the later section, “Hardware Installation with IO-IRQ Utility”) or the quick hardware installation (detailed right in the next section, “Quick Hardware Installation”). The latter is provided to facilitate the hardware installation, only under the circumstances that: u u u Only one Smartio C168 Series board is allowed to install in a system. Windows NT and 95/98 are the only operating systems supported.
Hardware Installation software configuration program will automatically update the hardware settings. After this, users already complete the whole installation. 4. Shutdown System (Windows NT/95/98). 5. DO power OFF and then ON (or Reset) the PC. (Please cold start.) 6. Restart System (Windows NT/95/98). It is very important to keep the JP1 always short in this case. Without running the hardware configuration program, Io-irq.
Because the ASIC-designed Smartio C168 Series has no switch and no jumper for configuring manually the I/O address, IRQ, INT vector, etc. of the boards, you must run the software utility, Io-irq.exe, in the driver diskette under DOS system to change the hardware configuration. 1. Choose a PC that has DOS system inside. 2. Power off the PC. 3. Make sure no hardware conflict and plug the board in a free 16-bit slot of the PC, one board at a time with JP1 open.
Hardware Installation typed correctly. With the correct CAP address, the utility can find the configuration stored in the on-board EEPROM and display it on the configuration panel. The CAP address is the only channel via which the configuration utility Io-irq.exe can access the board. 1. Run the utility “Io-irq.exe” contained in the driver diskette to set up I/O address, IRQ and INT vector of the board. 2. Select “Smartio/Industio ISA Family” and press ENTER key.
3. Enter the CAP address of the Smartio C168 Series board to be configured. 4. Configure the following parameters as necessary. Port Index Indicate the port index for each port. I/O address Enter the base I/O address for each port, either sequentially or not. Avoid to conflicting with any other devices. IRQ Enter the IRQ, 2, 3, 4, 5, 7, 10, 11, 12 or 15, for each port, independently or not. Speed This field specifies the use of normal or high speed capability. Normal speed ranges from 50 bps to 115.
Hardware Installation Note that, currently, port that uses MOXA Windows NT and 95/98 driver will run at the displayed speed. To be clear, when Smartio C168 Series board is configured as High Speed Spectrum, any port driven by the Moxa-provided Windows NT and 95/98 driver will display the exact working speed. For example, the displayed speed 38.4 Kbps is equal to the working speed 38.4 Kbps.
Normal Speed Spectrum 50 (bps) 75 110 134.5 150 300 600 1200 1800 2400 4800 7200 9600 19.2K 38.4K 57.6K 115.2K INT Vector High Speed Spectrum 400 (bps) 600 880 1076 1200 2400 4800 9600 14.4K 19.2K 38.4K 57.6K 76.8K 153.6K 307.2K 460.8K 921.6K Enter the interrupt vector I/O address for all ports. I/O address for interrupt vector is from 00000H to 0FFFFH. Interrupt vector is one byte of I/O address, in which each bit is used to indicate the occurrence of interrupt for corresponding port.
3 3 Software Installation In this chapter, the software driver installation, configuration and driver update/removal procedures are described for various operating systems, including Windows NT, Windows 95/98, UNIX and DOS Before proceeding with the software installation, complete the hardware installation, detailed in previous chapter, “Hardware Installation”.
Installing Driver Following is the procedure for installing the Smartio C168 Series driver for the first time under Windows NT 4.0. Note ! Make sure the board(s) has(have) already been plugged in the system slot(s) if you are doing quick installation. 1. Please log in NT as Administrator. 2. Open the [Control Panel], click on the [Network] icon and select the [Adapters] tab. 3. Click on the [Add] button, then the [Have Disk...] button in “Select Network Adapter”. 4.
Software Installation 5. Select “MOXA Smartio/Industio Family multiport board” in the “Select OEM Option” dialog box, and then click [OK] to enter the “Moxa Smartio/Industio Configuration Panel” dialog box to start the installation. 6. In the “Moxa Smartio/Industio Configuration Panel” dialog box, click [Add] to enter “Property” dialog box to add the Smartio C168 Series board. Select the “C168 Series” in the “Board Type” field.
Note ! You may go directly to the step 8 if you need not change any setting. 7. In the “Property” dialog box, select the desired port in the port list and click [Port Setting] to enter the individual “Port #” setting dialog box to change the port COM number mappings or FIFO settings.
Software Installation l Port Number You have to set up all the ports of the board with the desired “COM number”, which should not conflict with other COM number in use. In this “Individual Port Setting” dialog box, you may have two ways to map the physical ports to COM numbers depending on the check box “Auto Enumerating COM number”. If “Auto Enumerating COM Number” is checked and specify the COM number of the first port, subsequent ports are mapped to continuous COM numbers.
9. When configuration is done, click on [OK] button in the “Network Settings” dialog box. 10. Restart Windows NT system. The latest configuration will not take effect unless the system restarts. Note ! The latest configuration will not take effect unless the system restarts. 11. Once the system restarts, you may check the event log issued by the MOXA driver to see if the ports of the board are initialized successfully.
Software Installation Note ! Once the board and the driver are installed and the driver restarts successfully, you can start to develop applications with the PComm library (See “Serial Programming Tools” chapter) or the Microsoft Win32 API. You can also execute any ready-made applications, such as PComm utility Terminal emulator (See “Serial Programming Tools” chapter) or HyperTerminal to transmit/receive data, as well as Remote Access Service to provide dial-up networking capabilities.
3. Click on the [Property] button to open the “Moxa Smartio/Industio Configuration Panel” dialog box. Please see steps 6-10 in the previous section, “Installing Driver”, for more details. In this configuration panel, you may: l Click [Property] to enter “Property” dialog box to configure the selected board with the correct “COM Number”, “INT Vector”, “Interrupt no” and “Base I/O Port Address”.
Software Installation Updating Driver To update the driver for the Smartio C168 Series boards, simply remove the driver, as described in the next section, and reinstall it as detailed in section, “Installing Driver”. Removing Driver To remove the driver for the Smartio C168 Series boards, 1. Open the [Control Panel], click on the [Network] icon, and select the [Adapters] tab. 2.
Installing Driver Up to four Smartio C168 Series boards can be installed together as long as the I/O addresses and IRQ number resources are sufficient and available in a system. The following is the procedure for installing Smartio C168 Series for the first time under Windows 95/98: 1. Run Setup95.exe in the driver diskette. 2. Click on [Next>] button in the “Welcome ...” message dialog box. And then click on [Next>] button in the “Ready ...” message dialog. 3. Click on [Finish] button in the “Complete ...
Software Installation Note ! 6. Go directly to the step 7 if you need not change any setting. In the “Property” dialog box, select the desired port in the port list and click [Port Setting] to enter the individual “Port #” setting dialog box to change the port COM number mappings or FIFO settings.
l Port Number You have to set up all the ports of the board with the desired “COM number”, which should not conflict with other COM number in use. In this “Individual Port Setting” dialog box, you may have two ways to map the physical ports to COM numbers depending on the check box “Auto Enumerating COM number”. If “Auto Enumerating COM Number” is checked and specify the COM number of the first port, subsequent ports are mapped to continuous COM numbers.
Software Installation 8. Restart Windows 95/98 system. Note ! The latest configuration will not take effect unless the system restarts. 9. When system restarts, all the error conditions of the board will be popped up onto the screen if any. Otherwise, everything should be fine. If error message like “Smartio C168 Series (CAP=0x0180, port 1=COM3): Board is not found” appears, refer to chapter, “Troubleshooting”, for solutions.
Configuring Board and Port If you already have installed the driver and want to re-configure the Smartio C168 Series board and ports, add more boards or delete boards under Windows 95/98, the following is the procedure for you. 1. Click on the Taskbar [Start] button, then select [Programs] menu, then [MOXA Utilities] menu and then [Moxa Smartio/Industio Configuration Panel] icon. 2. The Smartio/Industio configuration panel will be popped up.
Software Installation Updating Driver Open [Control Panel] icon, and then [System] icon, and then select [Device Manager] tab. Then select and open the “MOXA Smartio/Industio Multiport Board” option and then select the “C168 Series”. Click on [Properties] button and then select [Driver] tab and then click on [Update Driver] button.
Removing Driver Open [Control Panel] icon, and then [Add/Remove Programs] icon, and then select [Install/Uninstall] tab. Then select and open the “MOXA Smartio/Industio Driver” option and then enter [OK] to remove the driver.
Software Installation DOS MOXA DOS API-232 is a software package that assists users to develop and/or debug programs for serial communications. This section will show you how to install the package, how to setup up the driver, and how to load or unload driver. For details of the serial programming (API-232 Library) and utilities, please refer to the next chapter, “Serial Programming Tools”. Installing Driver Run the installation program, DOSINST.EXE, in the DOS driver diskette.
After installation is complete, you will be prompted to proceed running setup program. It is strongly recommended to do so. Driver Setup The following are steps for setting up the Smartio C168 Series driver. Note that it is not intended to illustrate all the convenient functions of the setup programs when configuring the boards. Please refer to the F1 on-line help instructions as running setup program. 1. Run the setup program, BIN\SETUP.EXE, in the API-232 directory.
Software Installation 2. Press Enter to pop up the SETUP dialog box. In the SETUP dialog box, Press F8 to specify the CAP Address and press ENTER and then type Y (YES) to load the configuration of the board to be setup.
3. Now the configuration of the desired Smartio C168 Series board will be shown along with other default settings, such as port number, buffer size, etc. Note ! Up to now you have completed the setup for Smartio C168 Series board. You may skip this step and go directly to the next step 5 if you need not change any setting or configure any board.
Software Installation You may now enter/modify each port’s configuration. These displayed values are the port initial values as driver is loaded. Legend: Port number: Some noticeable fields and functions are explained below. This is actually the port ID of each port. The application software will refer to the port by its port number (ID). Duplicated port number is not allowed. That is, each MOXA serial port is referred to as port number in terms of serial programming.
F6: INT vector: This is to set interrupt vector for each port. You can set this feature to “Yes” (default) and gain best performance for the board. 4. Press F10 to save the latest configuration and exit the SETUP program. Loading Driver Having completed the setup, you can load the driver, “BIN\SER-DRV.EXE”, at the DOS prompt. The driver will detect the Smartio C168 Series board automatically. If the board(s) is(are) detected, a message similar to below will show: API-232 Version 3.
Software Installation If something went wrong, for instance, the board does not match the configuration or the board is missing, the screen will show a message like: API-232 Version 3.5 Universal 2/4/8 serial ports Communication Driver Setup driver … None serial port found!! It means the Smartio C168 Series driver is not installed properly. Please refer to chapter, “Troubleshooting”, for possible reasons and solutions.
Installing Driver The following description is for Smartio C168 Series under SCO UNIX/OpenServer and UNIX SVR4.2. Step 1. Login the UNIX system as a super user (root). Step 2. Change to root directory. # cd Step 3. / Insert the UNIX driver diskette into the floppy drive A: (or B:). If driver files are obtained from MOXA FTP service, put them under /tmp/moxa directory and skip the following 'tar' command. Step 4. Extract the files by, # tar xvf /dev/fd0135ds18 Step 5.
Software Installation Please select one of the following OSs: 1. SCO UNIX 2. UNIX SVR4.2 Select : Please select one of the devices where the driver diskette/files put: 1. /dev/fd0135ds18 (A: 1.44MB ) 2. /dev/fd096ds15 (A: 1.2 MB ) 3. /dev/fd1135ds18 (B: 1.44MB ) 4. /dev/fd196ds15 (B: 1.2 MB ) 5. Hard Disk /tmp/moxa Select : Then the MOXA Multiport Board Installation Utility will show for board installation. Choose C168 Series driver and follow the instructions to install. Step 6.
Step 7. Now you may shutdown the system and reboot. If you have trouble in booting the new UNIX kernel, use the backup kernel (/unix.moxa or /stand/unix.moxa) to boot your system and the system will work as before. Refer to Chapter “Troubleshooting” for more information. After the system starts up again, the following successful messages will show: For SCO UNIX/OpenServer, “C168 0x0180-0x01BF 11 Ver = x.x type=C168H (high speed)” For UNIX SVR4.2, “C168H board, base address 0x180, irq 5, Ver. x.
Software Installation MOXA TTY Device Naming Convention If the Smartio C168 Series is successfully configured, there will be two tty devices created for each port at /dev directory: one is non-MODEM tty (e.g. ttye11), and the other is MODEM tty (e.g. ttyE11). The two devices are actually accessing the same physical port except that the MODEM tty has to check the ON status of DCD signal to be able to open device, and closing device automatically as DCD signal is OFF.
Baud Rate Settings For Smartio C168 Series set to High Speed Spectrum, the real working speed, is exactly eight times of the speed displayed by “stty” command. A port, if set to Normal Speed Spectrum with 38.4 Kbps, will work at 38.4 Kbps for sure; while a port, if set to High Speed Spectrum with displayed speed 38.4 Kbps, will actually work at 307.2 Kbps (38.4 Kbps¡Ñ 8). Note also that the 50 baud rate, B50, will no longer stand for 50 bps, instead, it means 57600 bps, and 75 baud rate, B75, for 115.
Software Installation Basic Configuration In the [Basic configuration] dialog, users can set base I/O address and interrupt, which should be the same as the hardware configuration of the boards. Kernel rebuilding is required if any setting is changed. In [getty Setting] sub-dialog, there is one noticeable field: Non-Modem and Modem Baud Rate This field stands for the initial baud rate symbol and hunt sequence for Non-Modem /Modem tty.
others it may stand for 7-data-bit, even-parity. So, please examine the “getty default” file carefully, and make sure the terminal settings is the same. Otherwise, garbled data will be inevitable. Advanced Configuration In the [Advanced configuration] dialog, users can set baud rate mapping, Rx FIFO trigger level, Tx FIFO trigger level and RTS/CTS hardware flow control. Baud Rate Mapping There are two different baud rate tables can be selected: High Band and Low Band.
Software Installation Label High/Normal Speed B50 B75 B110 B134 B150 B200 B300 B600 B1200 B1800 B2400 B4800 B9600 B19200 B38400 Low Band 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 Normal Speed High Speed High Band 57600 115200 110 134 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 High Band 57600 115200 230400 460800 921600 200 300 600 1200 1800 2400 4800 9600 19200 38400 Note: You can press F1 on-line help to get more baud rate mapping information.
Tx FIFO Trigger Tx FIFO sizes from 1 to 16 bytes are available, and the default value is 16 bytes. RTS/CTS Hardware Flow Control This feature is for more flexible driver behavior. If set to “Disable” (default), CTS signal is not needed for tty port to transfer data and RTS/CTS hardware flow control function in driver is disabled. On the contrary, if set to “Enable”, CTS signal is needed for tty port to transfer data and RTS/CTS hardware flow control function in driver is enabled.
Software Installation Terminal Emulation This utility provides data sending and receiving ability of all tty ports, especially for MOXA ports. It is quite useful for testing simple application, for example, sending AT command to a modem connected to the port or used as a terminal for login purpose. Note that this is only a dumb terminal emulation without handling full screen operation. Besides, data scope function with pattern/file transfer is provided. 1.
2 Select and enter “Dumb Terminal” to enter terminal emulation. Or select and enter “Advance Transfer Modes” to perform pattern or file transfer with protocols such as ZModem. Driver Removal If you want to remove the Smartio C168 Series device driver and return to your previous system configuration, simply press Enter in this function entry and answer “Y” to confirm. Then the system will be rebuild. This may take some time. If you answer “N”, no action will be taken.
Software Installation Setting MOXA Ports to Terminal Following procedure is how to set the MOXA port to the “Terminal” for login purpose, taking ttya11 as an example, SCO UNIX/OpenServer # enable /dev/ttye11 UNIX SVR4.2 1. Edit (e.g. use vi editor) the file /etc/inittab. 2. Modify the tty entry from "ma11:23:off:/etc/getty ttye11 9600" to "ma11:23:respawn:/etc/getty ttye11 9600". 3. # init q Or refer to your UNIX system manuals for how to activate a tty port.
3-36 Smartio C168H/HS User’s Manual
4 4 Serial Programming Tools Moxa supports easy but powerful serial programming library and communication troubleshooting utilities under Windows NT, Windows 95/98, UNIX and DOS. You will save greatly the developing time, using MOXA Serial Programming Tools. The following sections will details the installation, the library and the utilities for various platforms.
PComm Programming Library The serial communication library is to assist users to develop programs for serial communications for any COM port complying with Microsoft Win32 API. It can ease the implementation of multi-process and multi-thread serial communication programs and hence greatly reduce the developing time. For complete library function description and example programs for Visual C++, Visual Basic and Delphi, please see help file and example programs in PComm directory for more details.
Serial Programming Tools Diagnostic (for MOXA boards only) A convenient diagnostic program provides internal and external testing, such as IRQ, TxD/RxD, UART, CTS/RTS, DTR/DSR, DTR/DCD testing, etc., for the MOXA boards and ports to verify correct operation of both the software and hardware.
Monitor (for MOXA boards under Windows NT Only) A useful port status monitoring program allows you to watch the selected MOXA COM ports' data transmitting/receiving throughput and communication line status which are updated and displayed on the screen at every time interval. In addition, you may click on one of the specific displayed port in order to see the current communication parameters and status of that port.
Serial Programming Tools Terminal Emulator The Terminal Emulator features multi-windows and supports terminal types of VT100 and ANSI. You can transfer data interactively, send pattern periodically or transfer file using ASCII, XMODEM, YMODEM, ZMODEM and KERMIT protocols.
UNIX Programming the MOXA Ports The system calls that apply to standard tty port can also be applied to MOXA port since MOXA port conforms to UNIX tty standard. System calls are like open(), ioctl(), read(), write(), close(), etc. Please refer to your UNIX Programmer's Reference manual. However, these system services only provide limited functions and thus may not satisfy the sophisticated programmers' need.
Serial Programming Tools Syntax for SCO UNIX/OpenServer #define MIBUFED 0x401 int count; /* number of bytes queued in the buffer */ ioctl(moxa_fd, MIBUFED, &count); Syntax for UNIX SVR4.2 #include #include #define MIBUFED 0x401 struct strioctl ioc; int count; /* number of bytes queued in the buffer */ ioc.ic_cmd = MIBUFED; ioc.ic_timout = 0; ioc.ic_len = sizeof(int); ioc.
Syntax for UNIX SVR4.2 #include #include #define MOBUFED struct strioctl int buffer */ 0x402 ioc; count; /* number of bytes queued in the output ioc.ic_cmd = MOBUFED; ioc.ic_timout = 0; ioc.ic_len = sizeof(int); ioc.ic_dp = (char *)&count; ioctl(moxa_fd, I_STR, &ioc); Note: See MIBUFED for influence of STREAMS driver. 3. MTCRTS This function, only valid when hardware flow control is turned off (see MHWFLOW), is used to drive RTS signal on or off.
Serial Programming Tools setting = TurnON /* or TurnOFF */; ioc.ic_cmd = MTCRTS; ioc.ic_timout = 0; ioc.ic_len = sizeof(int); ioc.ic_dp = (char *)&setting; ioctl(moxa_fd, I_STR, &ioc); 4. MTCDTR This function, only valid when hardware flow control is turned off (see MHWFLOW), is used to drive DTR signal on or off. Syntax for SCO UNIX/OpenServer #define MTCDTR 0x404 #define TurnON 1 #define TurnOFF 0 ioctl(moxa_fd, MTCDTR, TurnON); ioctl(moxa_fd, MTCDTR, TurnOFF); Syntax for UNIX SVR4.
until the output buffer has 'enough space' again. The criteria to tell if the output buffer has 'enough space' is whether the output buffer reached its 'low water' level. That is the output buffer will accept further data only when the 'low water' level is reached. If the 'low water' value is relatively small, you may find that the output buffer become empty before you write another block of data (this is quite possible because UNIX is time-sharing multitasking environment).
Serial Programming Tools Syntax for SCO UNIX/OpenServer #define MSTATUS 0x407 int status; /* status = RS-232 line status */ /* bit0¡Ð CTS (1:on, 0:off) */ /* bit1¡Ð DSR (1:on, 0:off) */ /* bit2¡Ð DCD (1:on, 0:off) */ ioctl(moxa_fd, MSTATUS, &status); Syntax for UNIX SVR4.2 #define MSTATUS 0x407 #include #include
Syntax for SCO UNIX/OpenServer #define MHWFLOW 0x40e #define HWFlowControlOff 0x00 #define CTSFlowControlBitOn 0x01 #define RTSFlowControlBitOn 0x02 #define HWFlowControlOn 0x03 ioctl(moxa_fd, MHWFLOW, CTSFlowControlBitOn); ioctl(moxa_fd, MHWFLOW, RTSFlowControlBitOn); ioctl(moxa_fd,MHWFLOW, CTSFlowControlBitOn | RTSFlowControlBitOn); Syntax for UNIX SVR4.2 #include #include
Serial Programming Tools Utilities You can use the administration utility, moxaadm, to monitor port activity and to do terminal emulation, which are details as follows. Port Monitoring This utility gives you a quick view about all the MOXA ports' activities. You can easily learn each port's total received/transmitted (Rx/Tx) character count since the time when the monitoring is started. Rx/Tx throughputs per second are also reported in interval basis (e.g.
Terminal Emulator This utility provides data sending and receiving ability of all tty ports, especially for MOXA ports. It is quite useful for testing simple application, for example, sending AT command to a modem connected to the port or used as a terminal for login purpose. Note that this is only a dumb terminal emulation without handling full screen operation. Besides, data scope function with pattern/file transfer is provided. 1.
Serial Programming Tools 2. Select and enter “Dumb Terminal” to enter terminal emulation. Or select and enter “Advance Transfer Modes” to perform pattern or file transfer with protocols such as ZModem. DOS Installation API-232 Library is the professional serial programming tool for DOS. It is installed automatically along with the MOXA DOS drivers. The installation is detailed in Chapter “Software Installation”.
Utilities There are two utilities available for DOS: Data Scope and Diagnose, which are detailed below. Data Scope The Data Scope, BIN\SCOPE.EXE, is a suite of utility programs that can help users with system troubleshooting and serial communication debugging. There are three major functions in Data Scope utility: 1. The Data Scope utility offers transparent monitoring of serial communication lines and allows data to be streamed to disk storage for later analysis. 2.
Serial Programming Tools Please see on-line help as running BIN\SCOPE.EXE for more usage and capability information. Diagnose The Diagnose, BIN\DIAGNOSE.EXE, is a utility that can help users to diagnose the hardware condition of each port of the selected board. See on-line help for more details. Before executing it, please remove the Moxa driver in advance via executing “Mxdrv/Q” if the Moxa driver is running in the background.
There are 2 solutions to control RS-485 2-wire transmission. Solution 1 The following model is common in RS-485 2-wire transmission. sio_SetWriteTimeouts(port, 0); sio_RTS(port, 1); sio_write(port, buff, 10); sio_RTS(port, 0); sio_read(port, buff, 10); /* Set sio_write() into block mode if for Windows NT and Windows 95/98 */ /* Turn on RTS signal. The RS-485 port is ready for transmitting data. */ /* Write 10 byte characters in "buff".
5 5 Connection Option (Opt8x) and Cable Wiring In serial data communications, the term DTE is for Data Terminal Equipment like PC COM1/2, serial printer and terminal. The term DCE is for Data Communication Equipment like modem.
The followings are pin assignments for various connection options: Opt8A/S (DCE, DB25 Female) 2 3 4 5 6 7 8 20 RxD TxD CTS RTS DTR GND DCD DSR Opt8B/C (DTE, DB25 Male) 2 3 4 5 6 7 8 20 TxD RxD RTS CTS DSR GND DCD DTR Opt8D (DTE, DB9 Male) 1 2 3 4 5 6 7 8 DCD RxD TxD DTR GND DSR RTS CTS 5-2 Smartio C168H/HS User’s Manual
Connection Option (Opt8x) and Cable Wiring Type 1: To connect Smartio C168 Series to a DTE device.
PC COM2 port, Serial Printer, Terminal, or any DTE Device Opt8D Opt8D DTE Device DB9 Male DB25 Male RxD TxD CTS RTS DTR DSR GND DCD 2 3 8 7 4 6 5 1 2 3 4 5 6 20 7 8 TxD RxD RTS CTS DSR DTR GND DCD Type 2: To connect Smartio C168 Series to a DCE device.
Connection Option (Opt8x) and Cable Wiring Straight-through Cable Modem, or any DCE Device Opt8B/C Opt8B/C DCE Device DB25 Male DB25 Female TxD RxD RTS CTS DSR DTR GND DCD 2 3 4 5 6 20 7 8 2 3 4 5 6 20 7 8 RxD TxD CTS RTS DTR DSR GND DCD Modem or any DCE Device Opt8D Opt8D DCE Device DB9 Male DB25 Female RxD TxD CTS RTS DTR DSR GND DCD 2 3 8 7 4 6 5 1 2 3 4 5 6 20 7 8 RxD TxD CTS RTS DTR DSR GND DCD Smartio C168H/HS User’s Manual 5-5
Type 3: To connect Smartio C168 Series to a DTE with 3-pin wiring. If the “Hardware flow control” feature is set to “ON”, you must loop back (or short) the RTS with CTS and DSR with DTR, DCD on MOXA site, indicated in dash-lines of the following diagrams. If the “Hardware flow control” feature is set to “OFF”, you could just leave RTS, CTS, DSR, DTR, DCD open, ignoring the connection indicated in dash-lines.
Connection Option (Opt8x) and Cable Wiring PC COM2 port, Serial Printer, Terminal, or any DTE Device Opt8D Opt8D DB9 Male RxD TxD GND RTS CTS DTR DSR DCD DTE Device DB25 Male 2 3 5 7 8 4 6 1 2 3 7 4 5 6 20 8 TxD RxD GND RTS CTS DTR DSR DCD RS-422 Cable Wiring for Opt8J/F/Z RS-422 connection boxes designed for Smartio C168 Series are: Opt8J: Opt8F: Opt8Z: Connection box with 8 female RS-422/485 DB25 ports. Set the port switch to OFF position (RS-422) for the desired port(s).
RS-422 Pinouts for Opt8J/F/Z: Opt8J/F/Z 2 3 14 16 7 4 5 13 19 RxD+(B) TxD+(B) RxD-(A) TxD-(A) GND CTS+(B) RTS+(B) RTS-(A) CTS-(A) Opt8J only The RS-422 transmission distance can reach as long as 4000ft. The connection box needs an external power adapter to supply 5V DC power. Either 110V or 220V AC power adapter is selectable.
Connection Option (Opt8x) and Cable Wiring The followings are operation modes for RS-422: RS-422 Point-to-point Opt8J/F/Z 3 TxD+(B) 16 TxD-(A) 2 RxD+(B) 14 RxD-(A) 7 GND RS-422 Device RxD+(B) RxD-(A) TxD+(B) TxD-(A) GND RS-422 Broadcasting Opt8J/F/Z 3 TxD+(B) 2 RxD+(B) 16 TxD-(A) 14 RxD-(A) 7 GND RS-422 Device 1 RxD+(B) TxD+(B) RxD-(A) TxD-(A) GND RS-422 Device N RxD+(B) TxD+(B) RxD-(A) TxD-(A) GND Opt8J RS-422 with Handshaking Opt8J 3 TxD+(B) 16 TxD-(A) 2 RxD+(B) 14 RxD-(A) 7 GND 5 RTS+(B) 13 RTS-(A)
RS-485 Cable Wiring for Opt8J One RS-485 connection box designed for Smartio C168 Series is: Opt8J: Connection box with 8 female RS-422/485 DB25 ports. Set the port switch to ON position (RS-485) for the desired port(s). The Opt8J supports only 2-wire half-duplex RS-485 communication. Data+/- pins are served for both data transmitting and receiving, depending on the RTS signal.
Connection Option (Opt8x) and Cable Wiring RS-422/485 Impedance Matching For RS-422/485 serial communications, when an electrical signal travels through two different resistance junctions in a transmission line, the impedance mismatch will sometimes cause signal reflection. Signal reflection causes signal distortion, which in turn will contribute communication errors. The solution to this problem is to establish the same impedance at the line ends as in the line itself by terminating them with resistors.
5-12 Smartio C168H/HS User’s Manual
6 6 Troubleshooting Common Smartio C168 Series problems and possible solutions are listed below. If you still have problems, contact your dealer or Moxa for help. Or use the “Problem Report Form” at the end of this manual to report problems to your dealer at once for faster technical support. General Troubleshooting 1. The MOXA driver, while installing the driver, cannot detect the MOXA board. Hardware causes and solutions: a. The board is not installed or missing (absent). Please install it. b.
Software Causes and Solutions: a. Smartio C168 Series checks the line status (CTS) before it sends data out if the RTS/CTS flow control feature is set to “Enable” in the configuration or application program. Please refer to the “Connection Cable and Cable Wiring” chapter for proper wiring. Check the line status of the suspected port using the diagnostic LED indicators on the mini tester. b.
Troubleshooting To configure the board, you need to know the board’s Configuration Access Port (CAP) address. Because the CAP address is the only channel, via which the Ioirq.exe can access to the board. The following procedure instructs user to recover once the CAP is unknown. Step 1. Power off the PC. OFF Step 2. Install jumper onto the JP1 of the board. Install jumper JP1 Step 3. Power on the PC. Now the CAP address of the board will be 0xA700. ON Step 4. Execute Io-irq under DOS environment.
Step 8. Power off the PC. OFF Step 9. Remove the jumper on position JP1. Remove jumper JP1 Step 10. Power on the PC. ON Windows NT This section is specific for troubleshooting under Windows NT. For general problems and solutions, please see the previous section, “General Troubleshooting”. 1. After the system reboots, the error message “Another driver in the system, which did not report its resources, has already claimed the interrupt used by xxx.” appears in the Event Log.
Troubleshooting a. Some partial decoded network board may interfere with our board. Please avoid from using 0x300 as I/O address for those network boards. b. Check hardware configuration of Smartio C168 Series board by IOIRQ.EXE. Then make sure the hardware configuration, including I/O addresses for each port, Interrupt Vector, IRQ, is identical to that of the driver. c. The I/O addresses may conflict with other devices, please change another set of I/O address such as I/O:0x280, Interrupt Vector:0x2C0.
addresses for each port, Interrupt Vector, IRQ, is identical to that of the driver. c. The I/O addresses may conflict with other devices, please change another set of I/O address such as I/O:0x280, Interrupt Vector:0x2C0. d. The board(s) is not plugged properly. Please make sure the board is seated firmly in the expansion slot. e. The slot for plugging the board is defective. In this case, please try other slots until you find a good one. f. The board might be defective.
Troubleshooting “Time out table overflow”: “File table overflow”: “Region table overflow” : NCALL parameter too small. NFILE or NINODE parameter too small. NREGION or NPROC parameter too small. 2. Under UNIXs, the newly rebuilt kernel could not boot. Software Causes and Solutions: The C168 driver might not be built into the new kernel correctly. a. Please use the last good kernel backup to boot again. The kernel backup in SCO UNIX is /unix.moxa while in UNIX SVR4.2 /stand/unix.moxa. b.
6-8 Smartio C168H/HS User’s Manual
Appendix A Technical Reference Specifications v v v v v v v v v v v v v v v v Bus interface: Number of ports: I/O address: IRQ: Data bits: Stop bits: Parity: UART: Speed (bps): Connectors: Data signals: ISA (EISA compatible) 8 0x0000 ~ 0xFFFF 2, 3, 4, 5, 7, 10, 11, 12, 15 5, 6, 7, 8 1, 1.5, 2 none, even, odd, space, mark 8¡Ñ 16550C or compatible 50 ~ 921.
Smartio C168 Series Windows NT Windows 95/98 DOS SCO UNIX/OpenServer UNIX SVR4.2 Linux SCO XENIX QNX FreeBSD 3 3 3 3 3 R C C C 3: Driver supported by Moxa and shipped with product C : Driver supported by OS R : Available by request Note: Download the newest drivers from the MOXA FTP service UART 16C550C The UART chip, 16C550C, is an intelligent asynchronous controller capable of supporting one full duplex channel that simultaneously transfers data at 921.6 Kbps.
Troubleshooting PC I/O Port Address Map The following is the list of the I/O port addresses commonly used, which is good for preventing I/O address conflict when configuring Smartio C168 Series.
DB62 Connector Pinouts The following lists the pin assignments of the DB62 connector on the bracket. Pin no. Signal Pin no. Signal Pin no.
Problem Report Form Smartio C168 Series Customer name: Company: Tel: Email: Fax: Date: 1. Moxa Product: Smartio C168 Series Model : oC168H oC168HS Serial Number: ___________ 2. Moxa Driver Version: ________________ 3. Moxa hardware settings: 3.1 Please check the hardware configuration by IO-IRQ.EXE from DOS or Windows 95/98 DOS Prompt. PORT I/O IRQ 1 2 3 4 5 6 7 8 Interrupt Vector: ________ Speed: ________________(High/Normal) 3.2 Jumper JP1 on the board: o open o short 4.
Return Procedure For product repair, exchange or refund, you must: v Provide evidence of original purchase v Fill out the Problem Report Form (PRF) as detailed as possible for shorter product repair time. v Obtain a Return Merchandise Authorization (RMA) number from the sales representative or dealer v Carefully pack the product in anti-static package, and send it, pre-paid, to the dealer.