C360 SuperPort System A Super Professional Intelligent Multiport Board for IBM PC/AT and Compatible System Dec.
Copyright Notice This documentation is copyrighted by Moxa Technologies Co., Ltd. All rights are reserved. Moxa Technologies reserves the right to make improvements to the products described in this manual at any time without notice. Information provided in this manual is intended to be accurate and reliable. However, Moxa Technologies assumes no responsibility for its use, nor for any infringements of rights of the fourth parties which may result from its use.
Moxa Internet Services Customer’s satisfaction is always our number one concern. To ensure customers get the full benefit of our services, Moxa Internet Services (MIS) have been built for technical support, product inquiry, new driver upgrade, etc. The followings are the services we provide. E-mail for technical support address: support@moxa.com.tw Ftp site for free driver upgrade address: ftp.moxa.com or ftp.moxa.com.tw user ID: ftp password: your_email_address World Wide Web (WWW) for product info.
Table of Contents . Chapter 1 Introduction 1.1 1.2 1.3 Overview Features and Specifications Check list . Chapter 2 Hardware Installation¡@ 2.1 2.2 2.3 2.4 2.5 Installation of C360 Rack Mount Kit Serial Number of the Async Concentrator LED Indicators Diagnostics . Chapter 3 For DOS Users¡@ 3.1 3.2 3.3 3.4 3.5 Software Driver Installation and Setup MOXA Serial Port Naming Convention Dos API-232 Library and Programming Languages Administrations Data Scope . Chapter 4 For UNIX Users¡@ 4.1 4.2 4.3 4.4 4.
Appendix A Troubleshooting Problem Report Form Appendix B B.1 B.2 B.
C 1.1 hapter 1 Introduction Overview The C360 SuperPort System is a newly-designed 16 to 256 port serial communication solution, which features high speed, large scale, distributed, and easy layout. It is designed for industrial and office applications where an AT/386/486/Pentium system needs to communicate with multiple terminals or devices through serial interfaces. One C360 provides 16 to 256 full duplex serial ports.
Chapter 1 • • Introduction 1.2 Features and Specifications Features v v v v v v v v v v v v v v ASIC-designed control board, compact size No switch, no jumper - easy configurable by software I/O mapped architecture - no shared memory wasted Low host CPU overhead RISC-based Async Concentrator Rack mountable - industry standard 19" rack High speed - up to 460.
Introduction • • Chapter 1 Control Board v 16-bit ISA bus (EISA compatible) v I/O mapped address: 200H, 220H, 240H,260H, 280H, 2A0H,2C0H,2E0H, 300H, 320H, 340H, 360H 380H, 3A0H, 3C0H, 3E0H. (needs 32 bytes) v IRQ: 2, 3, 4, 5, 10, 11, 12, 15 v Ethernet interface: BNC (for 10BASE-2/Coaxial) and UTP (for 10BASET/Twisted pair), selectable by software IO-IRQ.EXE v Transmission rate: 10M bps v Dimensions: 15.8 cm x 6.
Chapter 1 • v v • Introduction Operating temperature: 0 °C ~ 55 °C 110V or 220V AC, auto-select AAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAA AAAA AAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAA AAAAAAAA AAAAAAAA AAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAA AAAA AAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAA AAAAAAAA AAAAAAAA AAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAA AA
Introduction • v • Chapter 1 Rack Mount Kit 5
C hapter 2 Hardware Installation 2.1 Installation of C360 Step 1: Choose a PC that has DOS system inside. NOTE: No matter what OS used, user has to configure the C360 Control Board via IO-IRQ.EXE under DOS. Step 2: Power off the PC. Step 3: Install the C360 Control Board(s) into a 16-bit slot(s). NOTE: If installing more than one C360 Control Boards, insert ONE AT A TIME and configure it using the IO-IRQ.EXE program before inserting the next board.
Hardware Installation • • Chapter 2 Step 4: Power on the PC and enter DOS system. Step 5: Execute IO-IRQ.EXE which is included in the DOS API-232 software driver diskette, and follow the on-line help to configure the C360. Be careful not to conflict the I/O address and IRQ of the C360 Control Board with any existing board's. Step 6: After completing the configuration, the board is ready for use under DOS or SCO UNIX.
Chapter 2 • • Hardware Installation Hub AAAAAAAA AAAAAAAA AAAAAAAAAAAAAAAA AAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AsyncAAAA AAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA Concentrator AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA P1 BNC AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAA AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA AsyncAAAA AAAAAAAA AAAAAAAA BNC AAAAAAAA AAAAAAAAAAAAAAAA Concentrator AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAAAAAAAAAA S0 S0 P8 UTP S1 Tx P16 RX
Hardware Installation • • Chapter 2 2.3 Serial Number of the Async Concentrator It is the unique number identifying an Async Concentrator and written on a sticker which can be found at the left side of the rear panel of each Async Concentrator. User has to type in the serial number when setup the driver in the system. Under DOS, user can use "Auto-Search Serial No.
Chapter 2 • • Hardware Installation When hardware installation is complete, it is highly recommended to run diagnostic program, SP-ADM.EXE, under DOS to check the Control Board, the Ethernet cabling and Async Concentrator(s) as well as the compatibility between the PC and C360 Control Board. Before running SP-ADM.EXE, user has to run IO-IRQ.EXE to setup the Control Board, then run SETUP.EXE to setup the DOS driver, then run SP-DRV.EXE to install the DOS driver. For more information about SP-ADM.
Hardware Installation • • Chapter 2 11
C hapter 3 For DOS Users The C360 is useful for office automation and industrial control as well as data acquisition and communication. Because many users need to implement an industrial control system or data acquisition system in the DOS environment, but DOS did not has any better communication API, thus Moxa have developed a device driver and library functions under DOS which are called API-232 for DOS.
For DOS Users • • Chapter 3 running driver setup program, BIN\SETUP.EXE. Driver Setup Change to API-232 and run the setup program, BIN\SETUP.EXE, then choose C360 and specify the base I/O address, IRQ, number of Async Concentrators, port numbers range in board and system level, serial numbers in concentrator level, and communication parameters in port level.
Chapter 3 • • For DOS Users MOXA C360 SuperPort System Communication Driver (Ver. x.xx) Setup driver ... C360 Control Board 1: base I/O address [200] IRQ 10 Async Concentrator's serial no. : 101 102 Device Driver Setup O.K. , which means the C360 driver is installed properly. At this point, user is ready to execute application that supports API-232 functions, or start developing applications.
For DOS Users • • Chapter 3 Driver Removal To remove the C360 driver from memory, type SP-DRV/Q at the DOS prompt. 3.2 MOXA Serial Port Naming Convention Each MOXA serial port are referenced as port number in terms of programming. The port number is automatically assigned once the starting port number is decided by user when configuring the Async Concentrators.
Chapter 3 • • For DOS Users 3.3 DOS API-232 Library and Programming Languages For DOS programming, API-232 includes powerful libraries supporting languages like Microsoft C, Turbo C, Macro Assembly, QuickBasic, Turbo Pascal, Clipper, etc. Sample programs for each supported language are included. See the files in the sub-directory EXAMPLE\language of the API-232 directory. For complete API-232 function description, see API-232 User's Manual or file API-232.TXT in the API-232 directory for more details.
For DOS Users • • Chapter 3 Async Concentrator Diagnostics This utility gives user a quick view about all the Async Concentrators' and ports' status. It will diagnose the C360 in the system and report the hardware status, Good/Bad/No Response, of each port. It is strongly recommended to run this for verifying hardware condition, especially as soon as received C360 package. 3.5 Data Scope The Data Scope, BIN\SCOPE.
C hapter 4 For UNIX Users The C360 UNIX driver supports at most 256 TTY terminal ports in the UNIX system which are called MOXA TTY ports. The rest of the ports are called MOXA non-TTY ports. The differences between MOXA TTY and non-TTY ports are described below. In addition, C218/C320 Series can not co-exist with C360 in the UNIX system. Please remove C218/C320 UNIX driver before installing C360 UNIX driver. 4.1 Driver Installation Step 1.
For UNIX Users • • Chapter 4 1. /dev/fd0135ds18 2. /dev/fd096ds15 3. /dev/fd1135ds18 4. /dev/fd196ds15 5. /tmp/moxa (A: 1.44MB) (A: 1.2 MB ) (B: 1.44MB) (B: 1.2 MB ) (Hard Disk ) Select : For ... Tar files from driver diskette, please wait ... Then the MOXA Multiport Board Installation Utility will show for board installation. Follow the instructions prompted to install. Step 5. Now user may shutdown the system and reboot. If user has trouble in booting the new UNIX kernel, use the backup kernel (/unix.
Chapter 4 • • For UNIX Users Step 6. Enable the "Terminal" port for login purpose. Taking ttya11 as an example, for SCO UNIX/OpenServer/Open Desktop, # enable ttya11 Or refer to the UNIX system manuals for how to activate a tty port. 4.2 MOXA TTY and Non-TTY Ports Even though C360 can provide up to 1024 serial port in a system, only 256 ports among 1024 ports can be configured as TTY ports, the rest ports as nonTTY ports. MOXA TTY ports follow the standard of UNIX tty ports. But MOXA nonTTY ports do not.
For UNIX Users • • Chapter 4 "tty" + "A" + "B" + "C" port ordinal number in an Async Concentrator (from 1 to g) Async Concentrator ordinal number1111111 (from 1 to g) board ordinal number "a" or "A" : 1st MOXA board "b" or "B" : 2nd MOXA board "c" or "C" : 3rd MOXA board "d" or "D" : 4th MOXA board Capitals indicate a MODEM port Standard tty device prefix For example, if there is only one Async Concentrator configured, then the mapping of device names will be as depicted.
Chapter 4 • • For UNIX Users The MOXA non-TTY ports are simply referenced as port number in terms of programming. The port number is automatically assigned when configuring the Async Concentrators. For example, if there is only one Async Concentrator configured, then the mapping of device names will be as depicted.
For UNIX Users • • Chapter 4 User can select base I/O address and interrupt at will as long as no conflict will occurs. In [Concentrator Setting] dialog, there are several features that need explanation which is as follows: Async Concentrator Serial Number: This is the unique number identifying an Async Concentrator. User has to type in the serial number when installing the driver into the system at the very first time. Otherwise, user can use "Auto Search Serial No.
Chapter 4 • • For UNIX Users Monitoring This utility gives user a quick view about all the Async Concentrators' and ports' status. One 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. the last 5 seconds) and in average basis (since the time the monitoring is started). User can reset all ports' count by key.
For UNIX Users • • Chapter 4 The utility restarts the Async Concentrator(s) specified without shutting down the UNIX system. This is especially useful for replacing a defective Async Concentrator with a new Async Concentrator when any port of the original Async Concentrator is mal-functional. In this case, even though the serial numbers are different, "Driver Reset" is not suitable.
Chapter 4 • • For UNIX Users open( ), ioctl( ) , read( ), write( ), close( ), etc. Please refer to the UNIX Programmer's Reference manual. However, these system services only provide a limited functions and thus may not satisfy the sophisticated programmers' need. In order to meet the user's special needs, MOXA supports extended services through ioctl( ) command which are listed below.
For UNIX Users • 2. • Chapter 4 MOBUFED This function let user know the byte count queued in output buffer when this function is issued. #define MOBUFED 0x402 int count; /* number of bytes queued in the output buffer */ ioctl(moxa_fd, MOBUFED, &count); 3. MTCRTS This function, only valid when hardware flow control is turned off (see MHWFLOW), is used to drive RTS on or off. #define MTCRTS #define TurnON #define TurnOFF 0x403 1 0 ioctl(moxa_fd, MTCRTS, TurnON); ioctl(moxa_fd, MTCRTS, TurnOFF); 4.
Chapter 4 • #define MSTATUS int • For UNIX Users 0x407 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); 6. MHWFLOW This function is used to enable/disable hardware flow control. The first open() function of a port will set the MHWFLOW to configuration setting.
For UNIX Users • • Chapter 4 4.5 Programming the MOXA Non-TTY Ports Using MOXA UNIX API-232 Even though C360 SuperPort system provides up to 1024 serial ports, maximum of 256 ports can serve as standard UNIX TTY devices while the rest of the ports, up to 768, can only be used as MOXA non-TTY devices. To control MOXA non-TTY ports, MOXA proprietary functions in the MOXA UNIX API-232 library should be used, which are listed below.
Chapter 4 • 14. 15. 16. 17. • For UNIX Users sio_RTS( ) sio_flowctrl( ) sio_disableTx( ) sio_enableTx( ) Set modem line control signal RTS. Setting CTS/RTS and XON/XOFF flow control. Disable transmitting data. Enable transmitting data. Function Description: The following lists the syntax of MOXA non-TTY port functions. The variable port is the port number of a specific MOXA non-TTY port to be controlled.
For UNIX Users • int return port buf len 4. port buf len sio_write(int port, char *buf, int len) = >0 length of data transmitted to Tx buffer =0 buffer full -1 bad port -2 time out -5 port is not open = port number = transmit string pointer = transmit string length Put a block of data to Tx buffer. If the Tx buffer free space is smaller than block length, it will return zero. int return port buf len 6.
Chapter 4 • int return port baud mode 7. • For UNIX Users sio_ioctl(int port, int baud, int mode) = 0 ok -1 bad port -2 time out -4 bad baud rate = port number = 0 = 50 1 = 75 2 = 110 3 = 134.
For UNIX Users • int return port func 9. • Chapter 4 sio_flush(int port, int func) = 0 ok -1 bad port -2 time out -5 port is not open = port number = flush function (clear the assigned queue) 0 for input queue 1 for output queue 2 for input & output queue Read the length of data queued in Rx buffer. long return port sio_iqueue(int port) = >0 input queue size(bytes) -1 bad port -2 time out -5 port is not open = port number 10. Read the length of data queued in Tx buffer.
Chapter 4 • port • For UNIX Users = bit 2 -- S_RI bit 3 -- S_CD -1 bad port -2 time out port number 12. Set modem line control. int return port mode sio_lctrl(int port, int mode) = 0 ok -1 bad port -2 time out = port number = C_DTR(bit 0), C_RTS(bit 1) 13. Set modem line control signal DTR. int return port mode sio_DTR(int port, int mode) = 0 ok -1 bad port -2 time out = port number = 0 set DTR off 1 set DTR on 14. Set modem line control signal RTS.
For UNIX Users • int return port mode • Chapter 4 sio_flowctrl(int port, int mode) = 0 ok -1 bad port -2 time out = port number = bit 0 CTS flow control (0/1-off/on) bit 1 RTS flow control (0/1-off/on) bit 2 Tx XON/XOFF flow control (0/1-off/on) bit 3 Rx XON/XOFF flow control (0/1-off/on) 16. Disable transmitting data. int return port sio_disableTx(int port) = 0 ok -1 bad port -2 time out -5 port is not open = port number 17. Enable transmitting data.
Appendix A Troubleshooting Basically, to have data communication work, many things are involved. The following picture will help user to inspect where the problem is. AP 1 AP 2 API API OS OS Driver Driver PC 1 With Serial Board PC 2 With Serial Board or Serial Port MDM Serial Port MDM The philosophy for quickly solving a communication problem lies in isolation of the real question point. Communications would fail if any point on the way from AP 1 to AP 2 went wrong.
Technical Reference • 1 • Appendix B MOXA board not found. Hardware causes and solutions: a The I/O address user has selected for MOXA board conflicts with that of other interface boards such as SCSI, LAN, or Sound boards. If so, adjust the I/O address to forestall the conflict. b The MOXA board is not properly plugged in the system. If that is the case, then re-install the board and make sure that it fits well in a 16-bit slot this time. Sometimes the slot for plugging MOXA board is bad.
Appendix B • • Technical Reference Hardware Causes and Solutions: a Check if the Ethernet cable between the Async Concentrator and the Control Board is working segment by segment and firmly plugged and properly terminated. b Run the board configuration program to check the board configuration. Connect proper number of Async Concentrators as configured in configuration program. c If all the possible methods fail, the Async Concentrator might be defective.
Technical Reference • • Appendix B a In the UNIX system, C360 will check line status (CTS/DSR) before it sends data out if RTS/CTS flow control feature is set to ON. In this case, if user is using 3-pin (TxD, RxD, GND) cable, please run "moxaadm" and use configuration program to set the RTS/CTS flow control feature to OFF (strongly recommended). Or loopback (or short) the RTS with CTS and DTR with DSR on MOXA port site as follows.
Appendix B • • Technical Reference Hardware Cause and Solution: a Wrong IRQ setting. If the hardware and software IRQ setting do not match. MOXA driver will use a polling scheme and thus causes slow operation. Try to match the IRQ settings. 6 Under UNIX, when respawning quite a few number of tty ports, the following error messages appear: "Time out table overflow", "File table overflow", "Region table overflow".
Technical Reference • • Appendix B Appendix B B.1 Technical Reference Ethernet Cabling Async Concentrators' layout for C360 could be 10BASE-2 (BNC) and/or 10BASE-T (UTP) which conforming to Ethernet cabling rule.
Appendix B • • Technical Reference For 10BASE-2 with repeaters, the longest distance from C360 Control Board to the last Async Concentrator is about 1000 meters which is depicted as follows: 200 m C360 AC 200 m 200 m 200 m 200 m AC AC AC AC : Repeater AC : Async Concentrator Specifications for 10BASE-2 thin coaxial cable are as follows: v v v v B.2 Cable characteristics: 0.2 inch diameter RG-58A/U 50 ohm Max. segment length: 185 meters Min. distance between two nodes: 0.5 meter Max.
Technical Reference • B.3 • Appendix B RS-232 Cable Wiring Only RS-232 interface with RJ-45 female connector is supported.
Appendix B • • Technical Reference Type 1: To connect C360 to a DTE, e.g. terminal or PC COM1/2. (Please check the precise DTE pinouts, the following DTE pinouts is just an example) C360 RJ-45 Female DTE DB-25 Male C360 RJ-45 Female DTE DB-9 Male 1 2 3 5 6 7 8 9 8 DCD 20 DTR 5 CTS 3 RxD 2 TxD 7 GND 4 RTS 6 DSR 1 2 3 5 6 7 8 9 1 4 8 2 3 5 7 6 DCD DSR RTS TxD RxD GND CTS DTR Type 2: To connect C360 to a DCE, e.g. modem.
Technical Reference • • Appendix B Type 3: To connect C360 to a DTE, e.g. terminal or PC COM1/2, with 3-pin wiring if [Hardware flow control] feature is set to "ON".
Appendix C /* * * */ Example C program for controlling MOXA serial/Non-TTY ports using MOXA DOS/UNIX API-232 library #include void { Example Program "mxapi232.h" main() int char port_no, count, i; data[81]; /* Setting the port 9600, N, 8, 1, ...
Appendix C • • Example Program if (count > 80) count = 80; /* Read data from port */ if ((count = sio_read(port_no, data, count)) < 0) { printf("Port #%2d sio_read() error !\n", port_no); exit; } else if (count > 0) { data[count] = 0; printf("%s", data); } /* Write data ABCDEFGHIJ to port */ sio_putb(port_no, "ABCDEFGHIJ", 10 ); i--; } } sio_flush(port_no, 2); sio_close(port_no); /* Flush port's input & output queues */ /* Close port */ } 47
Problem Report Form Customer name: Company: Email: Tel: o C320 series o C102 family Moxa product: Date: Fax: o C218 series o C104 family o C360 o C168 family Moxa device driver version: _____________ Moxa hardware settings: memory (I/O) base address ____________ IRQ _________ Operating System: o DOS o Windows 3.x o Windows 95 (with version) o Windows NT o OS/2 o SCO UNIX 3.2.4 o SCO OpenServer Rel. 5 o SCO Xenix o SVR4.
WARRANTY Moxa guarantees its products against defective materials and workmanship for a period of one year from the day the original buyer receives the product. In the event that this product fails to be in good working order during this twelvemonth warranty period, the Dealer and the manufacturer will repair or replace this product at no additional cost to the customer. This guarantee does not apply to products which have been repaired or altered by other manufacturers.