serial_communication_tutorial_combined.pdf

Upload: salehimohsen13514969

Post on 03-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 serial_communication_tutorial_combined.pdf

    1/6

    Multiport Serial Board Solutions

    RS-232SerialCommunicationTutorial

    The most common and easy-to-use serial communication interface

    RS-232 Serial Communication Tutorial

    RS-232 is a straightforward, universal, and commonly implemented

    serial interface. Despite its limited 15 m transmission distance, its

    low cost and easy wiring features make RS-232 the first choice

    for many applications. RS-232 establishes two-way (full-duplex)

    communications, with signals represented by voltage levels

    measured with respect to a system common ground (power/logic

    ground). The idle state (MARK) is negative with respect to the

    common ground, and the active state (SPACE) is positive with

    respect to common ground.

    RS-232 Data Format

    Start bit: Always 1

    Data bits: 5, 6, 7, or 8 bits

    Parity: None, Odd, Even, Space, Mark

    Stop bit: 1, 1.5 (Data bits = 5), or 2 bits

    RS-232 Specs

    Standard Feature Mode ofOperation

    Drivers perLine

    Receivers perLine

    Max. CableLength

    Max. Data Rate

    EIA RS-232 Point to point Single Ended 1 1 50 feet 20 Kbps

    RS-232 Signal Definition

    The standard output signal level of RS-232 usually varies

    between +12V and -12V, with a dead area between +3V

    and -3V designed to absorb line noise. The TTL signal from the

    UART is between 0 and 5 volts, but after being transformed by

    the RS-232 transceiver, the signal voltage is changed to +12V

    to -12V.

    TxD Transmit Data

    RxD Receive Data

    RTS Request to Send

    CTS Clear to Send

    DTR Data Terminal ReadyDSR Data Set Ready

    DCD Data Carrier Detect

    GND Ground

    Sirius House, Peel Street, Southampton SO14 5QT, UK Tel: 44 (0)23 80571177 [email protected] www.captec.ws

    Karlsruher Strasse 11/1, D-70771, Leinf.-Echterdingen, Germany Tel: 49 (0)711 22063000 [email protected] www.captec-gmbh.deCaptec GmbH

    Captec Ltd

  • 7/29/2019 serial_communication_tutorial_combined.pdf

    2/6

    Total Solution for Industrial Device NetworkingRS-23

    2SerialCommunicationTutorial

    Flow Control

    H/W Flow ControlRTS and CTS signals are often used for H/W flow control.

    When a station is ready to receive, it raises the RTS signal to

    request transmit signals from the remote side.

    S/W Flow Control

    Sending an XON/XOFF pattern is a typical way to control data

    flow. When a station is ready to receive, the S/W sends an

    XON pattern. If the Rx buffer is almost full, the S/W sends an

    XOFF pattern to ask the remote side not to transmit.

    An Easy Programming ToolMOXA PComm Library

    Main Features

    Software developers are often confused by Microsofts

    complex Win32 COMM API, used to develop serial comm

    applications under Windows XP, Windows 2000, Windows

    NT, and Windows 95/98/ME. The confusion stems from the

    fact that Win32 COMM API is a general purpose utility, with

    very complex syntax. MOXA PComm Pro offers you a better

    solution.

    50 easy-to-use API Functions

    Supports VB, C/C++, Delphi Interface

    Compatible with Win32 Comm API Superior Troubleshooting Utilities

    Supports Z/Y/XModem, Kermit, and ASCII protocols

    Performance Analyzer

    Data Scope

    Sirius House, Peel Street, Southampton SO14 5QT, UK Tel: 44 (0)23 80571177 [email protected] www.captec.ws

    Karlsruher Strasse 11/1, D-70771, Leinf.-Echterdingen, Germany Tel: 49 (0)711 22063000 [email protected] www.captec-gmbh.deCaptec GmbH

    Captec Ltd

  • 7/29/2019 serial_communication_tutorial_combined.pdf

    3/6

    Multiport Serial Board Solutions

    RS-422/485SerialCommuicationTutorial

    Whats Needed for Industrial Applications

    Standard EIA RS-422A

    Feature Full-duplex,

    Point to point

    Mode of

    Operation

    Differential

    Drivers per Line 1

    Receivers per Line 10

    Maximum CableLength

    4000 feet

    Maximum Data

    Rate

    10 Mbps

    RS-422/485 SerialCommunication Tutorial

    Most devices used in todays industrial environments are

    designed for use with the RS-422/485 interface. This means

    that many users employ RS-422/485 serial communication

    boards in their PCs, allowing the PCs to connect to an industrial

    RS-422 or RS-485 network and transmit data over distancesup to 1.2 km. The RS-422/485 standards overcome the

    transmission distance limitation by using a differential signal for

    transmitting data and control signals. In addition to distance

    and multi-drop issues for industrial applications, isolation,

    housing, wiring, power supply, and over-surge protection are

    also important issues.

    RS-422

    RS-485

    Differential Transmission

    The RS-422 protocol greatly expands the

    practical possibilities of the serial bus. It

    provides a mechanism by which data can

    be transmitted over long distances (up

    to 4,000 feet) and at very high speeds

    (up to 10 Mbps). This is accomplished by

    using differential technology that splitseach signal into two separate wires in

    opposite voltage states, making this

    type of wiring configuration well suited

    for noisy environments.

    Multidrop Network

    RS-485 is an updated version of RS-422

    that is specifically designed to address

    the problem of communication between

    multiple devices on a single data line. It

    is a balanced transmission system with

    the ability to allow up to 32 devices to

    communicate using the same data line.

    This is achieved with tri-statable drivers that

    are usually controlled by a programmable

    handshake line to ensure that only one

    device acts as a driver at any given time.

    Standard EIA RS-485

    Feature Half-duplex,

    multi-dropMode of

    Operation

    Differential

    Drivers per Line 32

    Receivers per Line 32

    Maximum Cable

    Length

    4000 feet

    Maximum Data

    Rate

    10 Mbps

    Sirius House, Peel Street, Southampton SO14 5QT, UK Tel: 44 (0)23 80571177 [email protected] www.captec.ws

    Karlsruher Strasse 11/1, D-70771, Leinf.-Echterdingen, Germany Tel: 49 (0)711 22063000 [email protected] www.captec-gmbh.deCaptec GmbH

    Captec Ltd

  • 7/29/2019 serial_communication_tutorial_combined.pdf

    4/6

    Total Solution for Industrial Device Networking

    Limitations:

    *System must determine when to switch the transmitter on and off.

    *Only one node can switch on/off at any given time.

    Traditional Solution:

    Use the RTS signal to control the transmitter by software.

    Advanced Method:

    ADDC(Automatic Data Direction Control).

    Benefit:

    ADDCswitches the transmitter on and off very precisely

    by hardware, effectively simplifying the complexity of timing control by software.

    Result:

    The Industrial Multiport Communication Board uses embedded ADDC technology to automatically sense and control data

    direction instead of using RTS/CTS control, making the handshaking signal method obsolete.

    Termination

    Industrial Wiring Peripheral

    * Terminal Block* DIN-Rail Mounting

    RS-42

    2/485SerialCommu

    icationTutorial

    Termination is used to match impedance of both receive and

    transmission nodes. When impedance is mismatched, the

    transmitted signal is not completely absorbed by the load

    and a portion is reflected back into the transmission line. If

    the transmission line and load impedance are equal, these

    signal reflections are eliminated. The value of resistor needed

    to match the characteristic impedance is specified by the cable

    manufacturer, with a commonly used value of 120 ohms.

    ADDC(Automatic Data Direction Control)

    Isolation: Eliminate Ground Loops!

    A common problem in many industrial applications is ground loop

    currents that flow through the ground line when ground voltage levels

    differ between connected devices. To eliminate this problem, Moxas

    Industrial boards and full function converters are available with Optical

    Isolation up to 2000V.

    Five questions you need to ask about RS-422/485 selection:

    1. What is the system configuration?

    (2/4-wire RS-422/485)

    2. Are Isolation or Surge Protection available?

    3. What value of termination resistors are used?

    4. Is the resistor setup easily modified?

    5. What baud rate, or range of baud rates, are supported?

    TB-F9 TB-M9

    Sirius House, Peel Street, Southampton SO14 5QT, UK Tel: 44 (0)23 80571177 [email protected] www.captec.ws

    Karlsruher Strasse 11/1, D-70771, Leinf.-Echterdingen, Germany Tel: 49 (0)711 22063000 [email protected] www.captec-gmbh.deCaptec GmbH

    Captec Ltd

  • 7/29/2019 serial_communication_tutorial_combined.pdf

    5/6

    Multiport Serial Board Solutions

    RS-422/485SerialCommuicationTutorial

    Moxa RS-422/485 Solutions

    Industrial Board Comparison Chart

    Supported OS DriversMOXAs industrial COM port driver not

    only supports all major operating systems,

    but also the following dedicated operating

    systems for customers special needs.

    DOS (all Industrial Boards)

    OS/2 (ISA)

    SCO XENIX (ISA)

    QNX4 (ISA)

    QNX 6.x (PCI)

    Linux

    Industrial Board Selection Guide

    Model CI-132 CI-132I CI-132IS CP-132 CP-132I CP-132S CP-132IS CA-132 CA-132I CI-134 CI-134I CP-114 CP-114I CP-114S CP-114IS

    Bus ISA PCI PC/104 ISA PCI

    No. of Ports 2 4

    I/O Control-

    ler16C550C

    Connector

    TypeDB9 Male x 2 PC/104

    DB37 Female (with Optional accessories to 4 DB9/DB25 Male Con-

    nectors)

    Interface RS-422/485 RS-232/422/485

    Speed 50-921.6 Kbps

    RS-485

    IntelligenceADDC

    Parity None, Even, Odd, Space, Mark

    Surge

    Protection

    Isolation

    Data Bits 5, 6, 7, 8

    Stop Bits 1, 1.5, 2

    IRQ2(9), 3, 4, 5, 7, 10 (Default),

    11, 12, 15Assigned by BIOS

    3, 4, 5, 6, 7, 9, 10,

    11, 12, or 15

    2(9), 3, 4, 5, 7,

    10 (Default), 11,

    12, 15

    Assigned by BIOS

    I/O Address 0X0000-0xFFFF,

    Default: 0x 180

    Assigned by BIOS0X0000-0xFFFF,

    Default: 0x 180

    Assigned by BIOS

    Operating

    Temp0-55C

    Sirius House, Peel Street, Southampton SO14 5QT, UK Tel: 44 (0)23 80571177 [email protected] www.captec.ws

    Karlsruher Strasse 11/1, D-70771, Leinf.-Echterdingen, Germany Tel: 49 (0)711 22063000 [email protected] www.captec-gmbh.deCaptec GmbH

    Captec Ltd

  • 7/29/2019 serial_communication_tutorial_combined.pdf

    6/6

    Total Solution for Industrial Device Networking

    RS-422/485 Wiring Topology

    RS-422

    /485SerialCommuic

    ationTutorial

    4-Wire Full Duplex (Point-to-Point)

    2-Wire Half Duplex (Point-to-Point)

    2-Wire Half Duplex (Multi-Drop)

    4-Wire Full Duplex (Multi-Drop)

    RS-422

    RS-485

    RS-485

    RS-485

    Sirius House, Peel Street, Southampton SO14 5QT, UK Tel: 44 (0)23 80571177 [email protected] www.captec.ws

    Karlsruher Strasse 11/1, D-70771, Leinf.-Echterdingen, Germany Tel: 49 (0)711 22063000 [email protected] www.captec-gmbh.deCaptec GmbH

    Captec Ltd