PCL-740 Serial Communication RS-232/422/485/Current-Loop Interface Card

Similar documents
PCL-740 Serial Communication RS-232/422/485/Current-Loop Interface Card

PCL-741 Isolated Dual Port RS-232/Current-Loop Interface Card

PCL Port RS-232 Interface Card

PCL channel Isolated Digital Output Card

For technical support and service, please visit our support website at:

PCL channel Isolated Digital I/O Card

SW2. PCM-3641 User's Manual

PCM ch Isolated Digital I/O Module. User Manual

User Manual PCM Port CAN-Bus Mini PCIe Module with Isolation Protection

PCM PC/ bit Digital I/O Module. User Manual

PCI bit Digital Input/ Output Card for PCI Bus. User s Manual

PCI-1751U. 48-bit Digital Input/Output Card with Universal PCI Bus. User Manual

Model PCL Six Channel D/A Output Card

=0 Read/Write IER Interrupt Enable Register =1 Read/Write - Divisor Latch High Byte + 2

User Manual MIOe port CAN-bus PCIE/MIOe Module with Isolation Protection

PCL-725 Relay Actuator and Isolated D/I Card USER'S MANUAL

Four Port RS-232 Serial Interface

CHAPTER 1 GENERAL INFORMATION

PCI-1753 PCI-1753E. User Manual

RS-232 HS4 JANUARY 1997 IC131C CUSTOMER SUPPORT INFORMATION

Sender Receiver Sender

Product Manual. USB to Optical Adapter Industrial Isolated RS- 232/422/485. Coolgear, Inc. Version 2.1 December 2018 Model Number: USB-COMi-Si-M

Installation Guide of Hi-Speed USB to Octal RS-232/422/485 Adapter

8 Port USB to RS- 232/422/485 Octal Adapter. Product Manual. Coolgear, Inc. Version 1.1 April 2018 Model Number: USB-8COMi-RM.

User Manual PCI COMM Series User Manual. Industrial Serial Communication Cards

Contents INTRODUCTION...1 CARD SETUP...2 INSTALLATION...9 TECHNICAL DESCRIPTION SPECIFICATIONS... 13

PCL Communication. Industrial Serial Communication Cards with ISA Interface. User Manual

Introduction & Specifications of Hi-Speed USB to Serial Adapters

PCI Express 4-Port Industrial Serial I/O Cards

User Manual PCI COMM Series User Manual. Industrial Serial Communication Cards

Industio CP-114 Series User s Manual 3 in 1 RS-232/422/485 Industrial Serial Board for PCI Bus

Industio CP-114 Series User s Manual

UART Register Set. UART Master Controller. Tx FSM. Rx FSM XMIT FIFO RCVR. i_rx_clk o_intr. o_out1 o_txrdy_n. o_out2 o_rxdy_n i_cs0 i_cs1 i_ads_n

USB-16COMi-M 16-Port RS-422/485 USB Serial Adapter User Manual. Features and Specifications. Power Supply

Bluetooth TO Serial CONVERTER E-P132-B

EasySYNC Ltd. USB to Serial Converters Manual

EasySYNC Ltd. USB to Serial Converters Manual

Bluetooth to RS-232 Converter. RT-132B Bluetooth Adaptor Operation Manual

Korenix JetCard Series Multiport Serial Card/Ethernet Switch Card User s Manual

QSC-200/300. User's Manual

8-Port RS-232 PCIe Card

QSC(LP)-100. User's Manual

PCI Express 16-Port Serial I/O Cards

ACB-104 USER MANUAL. Part # Sealevel Systems, Inc PO Box 830 Liberty, SC USA. Phone: (864) FAX: (864)

3.1 I-7560 Pin Assignment and Specifications: Introduction

PCIe-400 USER S MANUAL

ESC(LP)-100. Eight Channel Low Profile RS-232 Asynchronous Communications Adapter. for PCI bus. User's Manual

Bluetooth to RS-232&RS422/485. EX-9132B/BI Bluetooth Adapter Operation Manual

DSC-200/300. User's Manual

W&T Manual Interface modules W&T

Wrenchman, Inc Old Hwy. # 8 Suite # 122 New Brighton, Minnesota (651)

SERIAL I/O PRODUCTS SEALEVEL I/O FAMILY NEW PRODUCT. RS-422/485 Serial I/O. RS-422/485 Specification

MEC-COM-M134. User s Manual

This 4-port RS-422/485 Adapter is provided with an external switching power adapter in the package.

Contents INTRODUCTION...1 CARD SETUP...2 INSTALLATION TECHNICAL DESCRIPTION SPECIFICATIONS... 14

EX Ch. Opto-isolated Digital Input Module OPERATING GUIDE

User Manual PCI Express COMM Series User Manual. Industrial Serial Communication Cards

MODEL P104-COM232-8 USER MANUAL

USB Connectivity. USB Connectivity

USER S MANUAL. PH232Ex1. #1 RS-232 Serial Port to Ethernet, Terminal Server/Client. Doc No: PH232Ex1-UM-001 IPEX. (IP Electronix)

Installation Guide of Hi-Speed USB to Industrial I/O Adapter

COMM+422.PCI USER MANUAL

MODEL USB-COM-2SM USER MANUAL

PCMCIA SERIAL INTERFACE CARD MODEL PCM485 USER MANUAL

MODEL USB-FLEXCOM4. USB to Four RS-232/422/485 Serial Ports and MODEL USB-COM232-4A USB to Four RS-232 Serial Ports USER MANUAL

Introduction & Specifications of Hi-Speed USB to Industrial Dual Ports RS-422/485 Adapter

Serial Interfacing. Pulse width of 1 bit

Hardware Manual. PCMCIA 1 Port RS EDITION APRIL 1999

USB-COMi-TB USB to Industrial Single RS-422 / 485 Adapter Manual. Specifications and Features

SeaLINK+8/USB. Sealevel Systems, Inc 155 Technology Place P.O. Box 830 Liberty, SC USA

Storage/Control I/O Module

Xtreme/104. PC/104 Serial Communications. User Manual

User Manual PCL channel Isolated Digital Output Card

Powered RS Port PCIe Card

EX & EX-45362IS 2S RS232/422/485 3-in-1 Serial PCIe Card

Manual Industry Interfaces

I-7560U/7561U/7563U. User Manual WARRANTY WARNING COPYRIGHT TRADEMARKS CONTACT US

User Manual PCIE-1172/1174. Reference Manual

Chapter 11: Input/Output Organisation. Lesson 05: Asynchronous RS232C Serial Port data transfer

CONFIGURATION GUIDE A-B REMOTE I/O LINK ADAPTOR FOR DL-KFR PC CARDS

Automationdirect.com. D i r e c t L o g i c M O D B U S S L A V E F 4 S L V - M B

DATA CONNECT ENTERPRISE

Product Manual. 2 Port USB to RS-422 /485 Optical Isolated Adapter. Coolgear, Inc. Version 1.1 March 2018 Model Number: USB-2COMi-Si-M

USB to RS-232/RS422/485. US-101-I USB To Serial Operation Manual

Installation Guide of Hi-Speed USB to Industrial Single RS-422/485 Adapter

User Manual PCL ch Isolated Digital I/O ISA Cards

USB to RS-232/RS422/485. URK-228-I USB To Serial Operation Manual

EMERALD-MM-8P. 8-Channel Software Programmable Protocol. Serial Port PC/104 TM Module. User Manual V1.20

MEV Limited USB232/485 INSTRUCTION MANUAL

Document Name : User Manual for SC10B : RS232 to Bluetooth Converter.

TABLE OF CONTENTS. Communication Functions

DSC-100. User's Manual

RS-422 Code-Operated Switches

User Manual A08. User Manual

CM17320HR User's Manual Octal RS-232/422/485 PC/104-Plus Module

ANC Series RS-422 Serial Communications Adapter

3710 ACM 3750 PDC 3800 RTU. ISOCOM Communications Card Retrofit Instructions

BeagleBone Black USB Expansion RS232 Module Cape Coolgear, Inc. Version 1.1 September 2017 Model Number:

PC231/PC241 EIGHT CHANNEL SERIAL COMMUNICATIONS BOARD WITH ISOLATION OPTION

Smartio C104H/HS User s Manual

Transcription:

PCL-740 Serial Communication RS-232/422/485/Current-Loop Interface Card

Copyright Notice This documentation and the software included with this product are copyrighted 1995 by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd. reserves the right to make improvements to the products described in this manual at any time without notice. No part of this manual or software may be reproduced, copied, translated or transmitted, in any form or by any means without the prior written permission of Advantech Co., Ltd. Information provided in this manual is intended to be accurate and reliable. However, Advantech Co., Ltd. assumes no responsibility for its use, nor for any infringements of rights of third parties which may result from its use. Acknowledgments PC-LabCard is a trademark of Advantech Co., Ltd. IBM, PC and PC/XT/AT are trademarks of International Business Machines Corporation. MS-DOS, MASM, QuickBASIC, Microsoft C and MS- PASCAL are trademarks of Microsoft Corporation. Intel is a trademark of Intel Corporation. Turbo C and Turbo PASCAL are trademarks of Borland International. MOXA is a trademark of 404 Technologies Inc. Part No. 2000740000 1st Edition Printed in Taiwan January 1995

Contents Chapter 1 Introduction... 1 Description... 2 Features...3 Applications...3 Specifications...4 Chapter 2 Hardware Installation... 7 Initial Inspection... 8 Jumper and Switch Location... 9 Card Configuration... 10 Jumper settings... 12 Card installation... 16 Chapter 3 Software Installation... 1 7 Card Setup... 18 DOS Driver Installation... 22 Driver removal... 22 Programming Example... 22 Chapter 4 Wiring... 2 3 Wiring... 24 RS-232 signal wiring...24 RS-422 signal wiring...26 RS-485 Signal wiring...27 Current Loop Signal Wiring...28 Pin Assignments... 28 Appendix A Register structure and format... 2 9 Register Structure... 30 Programming example... 33 Appendix B PC I/O Address Reference... 3 7

CHAPTER 1 Introduction Chapter 1 Introduction 1

Description The PCL-740 card enables RS-232, RS-422, RS-485 or current-loop serial communication for applications in difficult environments. You can configure its port to RS-232, RS-422, RS-485 or current-loop using on-board jumpers. The card features a 16C550 UARTs (with on-chip 16-byte FIFO) making serial I/O more reliable. By buffering data into 16-byte packets before putting it on the bus the UART drastically reduces the CPU load. This makes the PCL-740 especially suitable for high speed serial I/O applications and applications under MS Windows. In RS-485 mode, the PCL-740 automatically senses the direction of incomming data and switches its transmission direction accordingly. Therefore no handshaking signal (e.g. RTS signal) is necessary. This feature lets you simply and quickly build an RS-485 network with just two wires. More importantly, application software previously written for half duplex RS-232 environments, can be used without modification. Each PCL-740 comes with PC-ComLIB, a powerful, compact serial communications programming library for PC/XT/AT and compatible computers. PC-ComLIB supports most common languages, including C, Pascal, Visual Basic, assembly and Clipper. The PC-ComLIB package also includes the DataScope data viewer, terminal emulator and self-diagnostics utilities for easy troubleshooting and debugging. 2 PCL-740 User's Manual

Features Serial Port can be configured to RS-232/422/485 or current-loop 16C550 FIFO UART (with 16-byte FIFO) Baud rate up to 115 Kbps IRQ selection: 3, 4, 5, 6, 7, 9, 10, 11, 12 or 15 Complete RS-232 modem-control signals Space reserved for optional surge protection (RS-422/485 only) Space reserved for termination resistor (RS-422/485 only) LED indicator on each port indicates data flow Automatic data-flow control in RS-485 mode PC-ComLIB software included Applications PLC monitoring and control Serial communication in harsh environments Data entry terminals Remote data acquisition and control Instrument controller, distributed control systems Interface to modem, bar code reader, scale, plotter Multidrop communication networks Chapter 1 Introduction 3

Specifications Board Number of ports: 1 Protocol selection: RS-232/422/485 or current-loop UART: 16C550 (16-byte FIFO) I/O address selection: From 200H to 3F8H IRQ selection: 3, 4, 5, 6, 7, 9, 10, 11, 12 or 15 Power consumption: +5 V, 250 ma typical, 350 ma Max. Connectors: DB-9 male, DB-25 male Operating temperature: 32 to 122 o F (0 to 50 o C) Dimensions: 7.25" x 4.13" (18.4-cm x 10.5-cm) Weight: 0.2 Kg RS-232 interface Signal driver/receiver: SN 75188, SN 75189 Signals: TxD, RxD, RTS, CTS, DTR, DSR, DCD, RI, GND Mode: Asynchronous, full duplex Baud-rate: 50 to 115200 bps Stop bits: 1, 1.5, 2 Parity: Even, odd or none Data bits: 5, 6, 7, 8 4 PCL-740 User's Manual

Current-loop interface Signal driver/receiver: 6N136 Signals: TxD+, TxD-, RxD+, RxD- Current value: 20 ma (Standard) Mode: Asynchronous, full duplex Baud-rate: 50 to 115200 bps Transmission distance: 1000 m RS-422 Interface Signal driver/receiver: SN75176, SN75173 Signals: TxD+, TxD-, RxD+, RxD-, RTS+, RTS-, CTS+, CTS-, GND Mode: Asynchronous full duplex, point-to-point Max data rate: 115 Kbps Max data distances: 4000 feet (1220 meters) RS-485 Interface Signal driver/receiver: SN75176 Signals: DATA+, DATA-, GND Mode: Half duplex, multi-drop Max data rate: 115 Kbps Max data distances: 4000 feet (1220 meters) Programming Library (PC-ComLIB) Optimized, small-size resident (TSR) interrupt driver Supports C, BASIC, Pascal, Clipper and assembly Includes DataScope data viewer, terminal emulator and self-diagnostic utilities for easy troubleshooting and debugging Chapter 1 Introduction 5

6 PCL-740 User's Manual

CHAPTER 2 Hardware Installation Chapter 2 Hardware Installation 7

Initial Inspection Depending on the option you ordered, you should find (in addition to this manual) the following items inside the shipping container: PCL-740 RS-232/422/485/Current-loop Interface Card PC-ComLIB diskette PC-ComLIB user's manual We carefully inspected the PCL-740 mechanically and electrically before we shipped it. It should be free of marks and scratches and in perfect working order on receipt. As you unpack the PCL-740, check it for signs of shipping damage (damaged box, scratches, dents, etc.). If it is damaged or it fails to meet specifications, notify our service department or your local sales representative immediately. Also notify the carrier. Retain the shipping carton and packing material for inspection by the carrier. After inspection we will make arrangements to repair or replace the unit. When you handle the PCL-740, remove it from its protective packaging by grasping the rear metal panel. Keep the anti-vibration packing. Whenever you remove the card from the PC, store it in this package for protection. Warning! Discharge your body s static electric charge by touching the back of the grounded chassis of the system unit (metal) before handling the board. You should avoid contact with materials that hold a static charge such as plastic, vinyl and styrofoam. Handle the board only by its edges to avoid static damage to its integrated circuits. Avoid touching the exposed circuit connectors. 8 PCL-740 User's Manual

PCL-740 Jumper and Switch Locations RS-422/485 RS-232/Current-loop Current-loop select Tx Active/Passive Rx Active/Passive Protocol Selection Base Address IRQ Selection Chapter 2 Hardware Installation 9

Card Configuration Each port of the PCL-740 card has two associated status jumper groups and one six position DIP switch. If you do not use the boards default settings then these all require configuring prior to use. I/O port base address, interrupt level, RS-232/422/485/current-loop driver mode and receiver status all require setting up. The functions of the relevant DIP switches and jumpers are shown below. PCL-740 Switch and Jumper Options Selection Switches/Jumpers Function Protocol Selection JP5 RS-232/422/485/Current-Loop Current-Loop Status JP2 Current-Loop TX active/passive JP3,4 Current-Loop RX active/passive Address Selection S W 1 Base address for serial port IRQ Selection JP1 Interrupt level for serial port Please refer to the diagram on the previous page for jumper and DIP switch locations. 10 PCL-740 User's Manual

Default Settings The board will be shipped in the RS-232 mode. If your requirements are the same as this default setting, you may simply install the card without the need for any setting up. The PCL-740 DIP switch and jumper default settings are as shown below: Protocol selection - RS-232 mode (JP5) JP5 C.L. RS-485 RS-422 RS-232 Interrupt level - IRQ4 (JP1) IRQ 15 12 11 10 9 7 6 5 4 3 JP1 Base address - 3F8 (SW1) A3 A4 A5 A6 A7 A8 ON SW1 SW1 Chapter 2 Hardware Installation 11

Jumper settings Protocol Selection First you have to decide which mode each port will be operating in, RS-232, RS-422, RS-485 or current-loop driver mode. Select the correct jumper configuration on jumper JP5. RS-232 RS-422 RS-485 Current-Loop RS-232 RS-422 RS-485 C.L. RS-232 RS-422 RS-485 C.L. RS-232 RS-422 RS-485 C.L. RS-232 RS-422 RS-485 C.L. Note: When either RS-232, RS-422 or RS-485 mode is selected, the two current-loop Tx/Rx active/passive jumpers are inoperable. Current-Loop jumpers (JP2,3,4) Should you want to configure the PCL-740 to operate in the currentloop mode, configure the main jumper for current-loop. You also have to set Tx and Rx for active or passive mode. In the active mode the Tx or Rx will generate the current required for data transfer over the link. In the passive mode the current is generated by the card at the other end of the link. TxD RxD Active Passive RS-232 RS-422 RS-485 C.L. You may configure both the Tx and Rx to operate in the same mode, or you can configure each Tx and Rx to operate in different modes. Note: Whatever mode you select you must ensure that this is not the same mode as the device that your PCL-740 is connected to. The diagram on the next page shows a typical configuration. 12 PCL-740 User's Manual

PCL-740 port 1 Active Tx Active Rx Passive Rx Passive Tx Desktop computer Workstation or port 1 Active Tx Passive Rx Passive Rx Active Tx Plotter I/O Address and Interrupt Setup I/O Address Setup The I/O base address the PC-740 is selectable by a 6 position DIP switch, SW1. Refer to page 9 for the locations of the DIP switch SW1. The base address can be set anywhere in the I/O address area from hex 200 to hex 3F8. If you have more than one card installed you must select a different base address for each card. The factory default settings for the base address is Hex 3F8. A3 A4 A5 A6 A7 A8 ON SW1: Default base address - 3F8 The required switch settings for various base addresses are as shown on the next page: Chapter 2 Hardware Installation 13

Port base address (SW1) Base address A3 A4 A5 A6 A7 A8 200-207 l l l l l l 208-20F l l l l l - - 2E8-2EF l l - - 2F8-2EF l - - 3E8-3EF l - - *3F8-3FF l:on :OFF *:Default The following example shows how to set the base address to 2F8: The switch sum is set to 2F8 = 200 + 80 + 40 + 20 + 10 + 8, (HEX). Base address Deci- HEX line value value mal A3 8 8 A4 16 10 A5 32 20 A6 64 40 A7 128 80 A8 256 100 A9 512 200 A3 A4 A5 A6 A7 A8 ON NOTE: On the PCL-740 the address line A9 is does not appear on the DIP switch as it is permanently hard-wired to HEX 200 on the card.

Interrupt Level (IRQ) Setting The PCL-740 card is designed to access interrupt levels 3 up to level 15 with the exception of 8, 13, and 14. If the card is to be designated as COM1:, the interrupt level must be set to IRQ4 (the default). For COM2: the setting is IRQ3. Ensure that this does not conflict with any other card's IRQ. Simply place the jumper link on the required interrupt level as shown below: IRQ 15 12 11 10 9 7 6 5 4 3 JP1

Card installation Warning! Turn off your PC s power supply whenever you install or remove the PCL-740 or its cables. Static electricity can easily damage computer equipment. Ground yourself by touching the chassis of the computer (metal) before you touch any boards. See the static warning on page 8. 1. Turn off the computer. Turn the power off to any peripheral devices (such as printers and monitors). 2. Disconnect the power cord and any other cables from the back of the computer. Turn the PC if necessary to gain access to the cables. 3. Remove the PC s cover (refer to your user s guide if necessary). 4. Locate the expansion slots or passive backplane (at the rear of the PC) and choose any unused slot. 5. Remove the screw that secures the expansion slot cover to the PC (save the screw to secure the interface card retaining bracket). Remove the anti-vibration card clamp if supplied. 6. Carefully grasp the upper edge of the PCL-740 card. Align the hole in the retaining bracket with the hole on top of the expansion slot. Align the gold striped edge connector with the expansion slot socket. Press the board firmly into the socket. 7. Replace the screw in the expansion slot retaining bracket. Replace anti-vibration card holder. 8. Attach the DB-9 cable to the connector on the bracket. 9. Replace the PC s cover. Connect the cables you removed in step 2. Turn the computer power on. The board is now installed in the computer. See Chapter 4 for information on cabling. 16 PCL-740 User's Manual

CHAPTER 3 Software Installation Chapter 3 Software Installation 17

Software Installation Make a duplicate copy of the driver diskette in case the original disk becomes lost or damaged. Copy the files to a sub-directory on your hard disk if you desire. The PCL-740 comes with the PC-ComLIB software package. PC- ComLIB provides software drivers for DOS which supports most common languages, including C, PASCAL, Visual Basic, Quick Basic, assembly and Clipper. PC-ComLIB also includes the DataScope data viewer, terminal emulator and self-diagnostics utilities for easy troubleshooting and debuging. Please see the PC-ComLIB manual for detailed information. Card Setup The PCL-740 driver determines the configuration of the installed cards by reading a data file, GEN-DRV.CNF. When you first install the PCL-740, and each time you change the jumper settings, you will need to run the card setup program to save the settings to the configuration file. To invoke the setup program insert the driver disk in your computer and select the appropriate drive (or change to the directory on your hard disk containing the program files). Type SETUP (or SETUP H) if you have a monochrome screen) from the DOS prompt and press ENTER. You will then see the following screen: 18 PCL-740 User's Manual

PCL-740 Driver selection After the screen appears, move the cursor bar (using the arrow keys or the mouse) to the General Serial I/O Card field and press ENTER. Then press the PgDn key to get to the PORT SETUP screen, as shown below. PCL-740 Port set-up Chapter 3 Software Installation 19

Here you can set the configuration for each of the PCL-740 cards installed in the system. Set the IRQ, I/O address and port number to match the card's DIP switch settings. Do this by moving the highlighted field to the field you want to set-up. Press ENTER and a menu will appear allowing you to select the correct setting. The set-up program also controls the port number assignments for each card. When you use a driver function in your program, you will identify the ports by these assignments. You can alter all the fields shown on the screen, and you can change them if you require different settings. Remember that the interrupt number and base address should correspond to the jumper settings on the card. After you have set all the required fields, press F10 to save the settings or ESC to get to the previous page. The setup program will then create a new configuration data file, GEN-DRV.CNF. Note: Ensure that the base address and IRQ selected do not conflict with any other cards you may have installed in your system. PCL-740 Interrupt number selection 20 PCL-740 User's Manual

DOS Driver Installation Driver You must install the PCL-740 card driver (GEN-DRV.EXE) before you run any application programs, including the Datascope utilities. If you are installing the driver for the first time, you will need to run the set-up program (described in the previous section) to save the initial status of the PCL-740. Because the driver is a TSR (Terminate and Stay Resident) program, you can execute it at any time, you do not have to install it in the CONFIG.SYS file. To install the PCL-740 card driver change to the directory or floppy disk containing the driver files and type GEN-DRV. You should soon see the following message: PC-ComLIB communication Drive (Ver x.xx) General Serial I/O Card : aa Port DEVICE DRIVER SETUP O.K. Where: "aa" is the number of ports in your system. If the driver can not detect any card or the GEN-DRV configuration file is not in the same directory as the driver, the following message will be displayed: PC-ComLIB Communication Driver (Ver x.xx) General Serial I/O Card Not Found Device Driver SETUP Fail! removal To remove the driver TSR program, just type GEN-DRV/q from the DOS prompt. The following message will appear: PC-ComLIB Communication Driver (Ver x.xx) Release O.K. Chapter 3 Software Installation 21

Programming Example The following code extract illustrates how the library functions can simplify card programming, reduce setup time and avoid any bugs. The following C program shows a simple data transfer test. It uses a PC-ComLIB function call to send data between two RS-232 ports of two PCL-740s at a rate of 57.6 Kbps. /* Execute the PC-ComLIB TSR driver first*/ #include<head-c.h> main() { /* Setup PORT1 & PORT2 : buad = 57600 data = 8 stop = 1 no parity */ sio_ioctl(1,b57600,bit_8 P_NONE STOP_1); sio_ioctl(2,b57600,bit_8 P_NONE STOP_1); /* Enable communication ports */ sio_open(1); sio_open(2); /* Transmit data on Port 1 */ sio_write(1," Hello ",7); delay(200); /* Receive data on Port 2,store in buf1*/ sio_linput(2,buf1,7,13); /* Print received data */ printf("%s\n",buf1); /* Disable communication ports */ sio_close(1); sio_close(2); } See the PC-ComLIB user s manual for information on programming and linking your application programs with the driver libraries. 22 PCL-740 User's Manual

CHAPTER 4 Wiring Chapter 4 Wiring 23

Wiring RS-232 signal wiring Since the RS-232 interface is not strictly defined, many devices have their own connection methods which may ignore some signal lines or define reserved lines for other functions. It is best to refer to the user s manual for your device for installation instructions. You may find the following helpful. In general, DTE (Data Terminal Equipment) refers to the device that is leading the communication. Examples include PC s, terminals and some printers. DCE refers to the device being communicated with or controlled. Examples include modems, DSU s (digital service units), printers and lab/factory equipment. In some situations you may be able to get by with just three lines: data on TXD, a signal ground and a handshaking line. Examples are printer or plotter connections, troubleshooting and situations where you require only one-wire communication. Terminal or PC (DTE) connections DB-25 Male: PCL-740 DB-25 Male or Female: Terminal Pin Signal Pin Signal 2 TxD 3 RxD 3 RxD 2 TxD 4 RTS 5 CTS 5 CTS 4 RTS 6 DSR 20 DTR 7 GND 7 GND 20 DTR 6 DSR 8 DCD 8 DCD 24 PCL-740 User's Manual

Modem connections DB-25 Male: PCL-740 Modem (DCE) Pin Signal Pin Signal 2 TxD 2 RxD 3 RxD 3 TxD 4 RTS 4 CTS 5 CTS 5 RTS 6 DSR 6 DTR 7 GND 7 GND 20 DTR 20 DSR 8 DCD 8 DCD For DTE to DCE connection, use straight through cable, i.e. you don't have to reverse lines 2 and 3, lines 4 and 5, and lines 6 and 20. Because in general the DCE RS-232 interfaces are reversed themselves. Terminal without handshake DB-25 Male: PCL-740 Terminal, PC (DTE) Pin Signal Pin Signal 2 TxD 3 RxD 3 RxD 2 TxD 4 RTS 5 CTS 7 GND 7 GND 6 DSR 20 DTR 8 DCD The maximum length of a RS-232 cable is 100 ft. If you need to connect over longer distances, (longer than 100 ft), please use RS-422 or RS-485 modes to match this requirement. If not using CTS, RTS, DSR,DTR signals, please loop back for the PC-ComLIB software to function correctly, because PC-ComLIB will always check for handshake signals. Chapter 4 Wiring 25

RS-422 signal wiring For RS-422 interface, the wiring is based on one-to-one principle and the connections are as follows: DB-9 Male: PCL-740 DB-9 Male Terminal Pin Signal Pin Signal 1 TxD- 4 RxD- 2 TxD+ 3 RxD+ 3 RxD+ 2 TxD+ 4 RxD- 1 TxD- 5 GND 5 GND 6 RTS- 9 CTS- 7 RTS+ 8 CTS+ 8 CTS+ 7 RTS+ 9 CTS- 6 RTS- Terminator Resistors setup The terminal resistors for impedance matching on the PCL-740 are not installed at the factory. The user can install the resistors with the appropriate resistances according to the cards application. Each terminal resistor corresponds to a different channel for TxD+/- or RxD+/- lines. Usually, these resistors are needed for both ends of the communication wires and the value of the resistors should match the characteristic impedances of the wires used (approx 120 ohm). An example of the installation is as follows: 120Ω TR1 120Ω TR2 RS-422 Termination resistor installation 26 PCL-740 User's Manual

RS-485 Signal wiring The RS-485 standard supports half-duplex communication. This means that just two wires are needed to both transmit and receive data. Handshaking signals (such as RTS, Request To Send) are normally used to control the direction of the data flow and to switch the transmission accordingly. In RS-485 mode, the PCL-740 automatically senses the direction of the data flow and switches the transmission direction hence no handshaking is necessary. This means a user can build an RS-485 network with just two wires. This RS-485 control is completely transparent to the user. The Software written for half duplex RS-232 works without the need for any modification. The connections are as follows: DB-9 Male: PCL-740 DB-9 Male or Female: Terminal Pin Signal Pin Signal 2 DATA+ 2 DATA + 1 DATA- 1 DATA - 5 GND 5 GND D.T.E RS-485 Transceiver D.T.E RS-485 Transceiver D.T.E RS-485 Transceiver RS-485 Wiring topology Termination Resistor 120Ω TR1 RS-485 Termination resistor installation Chapter 4 Wiring 27

Current Loop Signal Wiring For Current loop interfacing, the wiring is based on one-to-one principle and the connections are as follows: PCL-740: DB-25 male PC or Terminal Pin Signal Pin Signal 9 TxD+ 25 RxD+ 11 TxD- 18 RxD- 18 RxD+ 11 TxD+ 25 RxD- 9 TxD- Pin Assignments The two diagrams below show the pin assignments for the DB-25 (RS-232/current-loop) and the DB-9 (RS-422/485) connectors: RS-232/Current-loop RS-422/485 28 PCL-740 User's Manual

Register and format A structure APPENDIX Appendix A Register structure and format 29

Register Structure This appendix gives short description of each of the module's registers. For more information please refer to the data book for the STARTECH 16C550 UART chip. All registers are one byte. Bit 0 is the least significant bit, and bit 7 is the most significant bit. The address of each register is specified as an offset from the port base address (BASE), selected with DIP switch SW1 or SW2. DLAB is the "Divisor Latch Access Bit", bit 7 of BASE+3. BASE+0 BASE+0 BASE+0 Receiver buffer register when DLAB=0 and the operation is a read. Transmitter holding register when DLAB=0 and the operation is a write. Divisor latch bits 0-7 when DLAB=1. BASE+1 Divisor latch bits 8-15 when DLAB=1. The two bytes BASE+0 and BASE+1 together form a 16-bit number, the divisor, which determines the baud rate. Set the divisor as follows: Baud rate Divisor Baud rate Divisor 50 2304 2400 48 75 1536 3600 32 110 1047 4800 24 133.5 857 7200 16 150 768 9600 12 300 384 19200 6 600 192 38400 3 1200 96 56000 2 1800 64 115200 1 2000 58 30 PCL-740 User's Manual

BASE+1 BASE+2 Interrupt Status Register (ISR) when DLAB=0 bit 0 Enable received-data-available interrupt bit 1 Enable transmitter-holding-register-empty interrupt bit 2 Enable receiver-line-status interrupt bit 3 Enable modem-status interrupt FIFO Control Register (FCR) bit 0 Enable transmit and receive FIFOs bit 1 Clear contents of receive FIFO bit 2 Clear contents of transmit FIFO bits 6-7 Set trigger level for receiver FIFO interrupt. Bit 7 Bit 6 FIFO trigger level 0 0 01 0 1 04 1 0 08 1 1 14 BASE+3 Line Control Register (LCR) bit 0 Word length select bit 0 bit 1 Word length select bit 1 Bit 1 Bit 0 Word length (bits) 0 0 5 0 1 6 1 0 7 1 1 8 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 Number of stop bits Parity enable Even parity select Stick parity Set break Divisor Latch Access Bit (DLAB) Appendix A Register structure and format 31

BASE+4 Modem Control Register (MCR) bit 0 bit 1 DTR RTS BASE+5 BASE+6 Line Status Register (LSR) bit 0 Receiver data ready bit 1 Overrun error bit 2 Parity error bit 3 Framing error bit 4 Break interrupt bit 5 Transmitter holding register empty bit 6 Transmitter shift register empty bit 7 At least one parity error, framing error or break indication in the FIFO Modem Status Register (MSR) bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 Delta CTS Delta DSR Trailing edge ring indicator Delta received line signal detect CTS DSR RI Received line signal detect BASE+7 Temporary data register 32 PCL-740 User's Manual

Programming example The following C example shows how to program the PCL-740's registers directly. It uses I/O ports hex 3F8 and 2F8 to test the PCL- 740 s send, receive and FIFO functions. /**************************************************/ /* Program: DEMO01.C */ /* Description: */ /* Sends a string from COM1 to COM2 then reads */ /* it back from COM2 and displays it on the */ /* screen. It uses direct register control. */ /**************************************************/ #include <dos.h> #include <io.h> #include <stdio.h> #include <conio.h> /* Timeout value in seconds */ #define TIME_OUT 10000 static int base0=0x3f8; /* Port 1 base address (COM1) */ static int base1=0x2f8; /* Port 2 base address (COM2) */ static char rec[16]; /* Receive buffer */ static char cmd[16]; /* Command buffer */ void main() { int i; timeout; /* counter for timeout */ char flag; /* Set up Port 1 (COM1) */ outport((base0+2),0xc9); /* Enable FIFO */ outp(base0+3,0x80); /* Set DLAB=1 */ /* Set bps = 115200 */ outp(base0,0x01); outp(base0+1,0x00); outp(base0+3,0x03); /* set data=8; stop=1; no parity*/ outp(base0+1,0x00); /* disable interrupt */ Appendix A Register structure and format 33

/* Set up Port 2 (COM2) */ outport((base1+2),0xc9); /* Enable FIFO */ outp(base1+3,0x80); /* Set DLAB=1 */ /* Set bps = 115,200 */ outp(base1,0x01); outp(base1+1,0); outp(base1+3,0x03); /* Set data=8; stop=1; no parity*/ outp(base1+1,0x00); /* Disable interrupt */ printf("\nenter string (max 15 char) or Q to quit:"); gets(cmd); while (cmd[0]!= q && cmd[0]!= Q ) { /* Send string on Port 1 (COM1) */ i=0; cmd[strlen(cmd)] = 0x0d; flag=1; while (flag) { outportb(base0,cmd[i]); /* Send data */ if (cmd[i] == 0x0d) flag=0; i++; } 34 PCL-740 User's Manual

/* Receive data on Port 2 (COM2) */ i=0; flag=1; timeout=time_out; while (flag) { /* Check for received data on port*/ if ((inportb(base1+5) & 1)!=0) { rec[i]=inportb(base1); /* Receive data */ if (rec[i] == 0x0d) { rec[i+1]= \0'; flag=0; printf( \nreceived data: %s\n, rec); } i++; } else { /* Check timeout */ timeout ; if (timeout == 0) { flag = 0; printf( \ntimeout error\n ); } } } /* End of receive data while() */ printf("\nenter string (max 15 char) or Q to quit:"); gets(cmd); } /* End of "Enter string" while() */ } /* End of main() */ Appendix A Register structure and format 35

36 PCL-740 User's Manual

APPENDIX B PC I/O Address Reference Appendix B: PC I/O Address Assignments 37

PC I/O Address Usage The following table indicates the PC I/O address usage assignment. To prevent conflicting settings of the PCL-740 with other devices or I/O cards, you are recommended to refer this table. I/O Address Device 000-00F DMA (8237A) 020-021 8259A IRQ Controller 040-043 8253/8254 Timer/Counter 060-063 PPI 8255A 070-071 Real-Time Clock 080-08F DMA Page Register 0A0-0BF 8259A Interrupt Chip 0C0-0DF Second DMA Controller 8237A 0F0-0FF Math Coprocessor 1F0-1F8 AT Fixed Disk 200-20F Game I/O 278-27F Parallel Printer Adaptor #2 2F8-2FF Serial Adaptor ( COM 2 ) 320-32F XT Fixed Disk 378-37F Parallel Printer Adaptor #1 380-38F SDLC Binary Communication Adaptor 3A0-3AF Master Binary Communication Adaptor 3B0-3BF Monochrome/Parallel Adaptor 3D0-3DF Color Graphics Adaptor 3F0-3F7 Diskette Controller 3F8-3FF Serial Adaptor ( COM 1 ) 38 PCL-740 User's Manual Москва: Телефон: (095) 234-0636 (4 линии) Факс: (095) 234-0640 BBS: (095) 336-2500 Web: http://www.prosoft.ru E-mail: root@prosoftmpc.msk.su Для писем: 117313, Москва, а/я 81 С.-Петербург: (812) 325-3790 Екатеринбург: (3432) 49-3459