Serial interfaces (RS232 and USB) for instrument control

Similar documents
RS-232 COMMUNICATIONS

When we look at the connector pinout of the RS232 port, we see two pins which are certainly used

Cable Guide. Click on the subject to view the information. Digi Cables Building Cables General Cable Information

RJ45 Shielded (standard) port pinout. CS9000, Jetstream , Lanstream 2000, RTA8/RJX, RRC16, MTA8/RJX & SXDC8/RJX

Application Note 83 Fundamentals of RS 232 Serial Communications

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

Quectel Cellular Engine

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

2-Port RS232/422/485 Combo Serial to USB2.0 Adapter (w/ Metal Case and Screw Lock Mechanism) Installation Guide

Advanced Data Capture and Control Systems

16-Port RS232 to USB2.0 High Speed Multi Serial Adapter (w/ Metal Case) Installation Guide

PCMCIA 1 Port RS EDITION OCTOBER 1999

LS-101 LAN to Serial Device server. User s Manual

Cable Specifications and Information

Manual Serial PCI Cards

WHQL Certification Approval...2 User Interface...3 SUNIX s COMLab..4

BLUETOOTH SERIAL PORT PROFILE. iwrap APPLICATION NOTE

LTM-1338B. Plus Communications Manual

Cabling Guide for Console and AUX Ports

2-Port RS232/422/485 Combo Serial PCI Card

Remote Serial over IP Introduction on serial connections via IP/Ethernet

version 3.1. Security modem with USB port user guide

Using Xbee in Serial Communication

PROLOGIX GPIB-USB CONTROLLER USER MANUAL VERSION May 14, 2013 PROLOGIX.BIZ

Cable Connection Procedures for Cisco 1900 Series Routers

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

Making a DB to RJ45 adapter.

Serial Communications

Modbus Communications for PanelView Terminals

EVAL-UFDC-1/UFDC-1M-16

RS-232 Communications Using BobCAD-CAM. RS-232 Introduction

Future Technology Devices International Ltd

How to setup a serial Bluetooth adapter Master Guide

Data sheet Wireless UART firmware version 4.02

Industrial Multi-port Serial Cards

MCB3101 (Class I) WiRobot Serial Bluetooth Wireless Module User Manual

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate With the Eagle System

isco Connecting Routers Back to Back Through the AUX P

a8251 Features General Description Programmable Communications Interface

Programming and Using the Courier V.Everything Modem for Remote Operation of DDF6000

USB TO SERIAL ADAPTER

1.1 Connection Direct COM port connection. 1. Half duplex RS232 spy cable without handshaking

Cable Pinouts. SRP I/O Module

The Secrets of Flow Control in Serial Communication

Technical Note #14. Phone Modem Device Support. GE ED&C Home Search ED&C GE ED&C Power Management Home GE ED&C PMCS Home

Bluetooth HC-06 with serial port module Easy guide

RS-422/485 Multiport Serial PCI Card. RS-422/485 Multiport Serial PCI Card Installation Guide

LOW COST GSM MODEM. Description. Part Number

Remote Data Collection Device CE Model DCDSS1

Teleservice via RS232 interface XC100/XC200

One Port Serial Server Users Manual Model ESP901, ESP901E

Cable Specifications. T3 Trunk Cabling APPENDIX

Appendix A. This Appendix includes the following supplemental material:

Encore Controller to Router Connections

Application Note. Terminal Server G6

Cable Guide Including all PortServer TS, Digi Connect, and Digi One Products

Access to Data & Computer Networks Physical Level

To perform Ethernet setup and communication verification, first perform RS232 setup and communication verification:

Using HyperTerminal with Agilent General Purpose Instruments

Why you need to monitor serial communication?

Data Cables. Schmitt TTL LABORATORY ELECTRONICS II

MDM192 MULTI-DROPS DIGITAL MODEM FOR PRIVATE LINE. USER GUIDE Document reference :

Siemens DECT Engine MD32. Product Description. Information and Communication Products

Connecting the Console Port to a PC

Docklight Pro Monitor User Manual 10/2015

By4750. USB Serial Converter (RS232 RS485)

PM1122 INT DIGITAL INTERFACE REMOTE

WHQL Certification Approval...2 User Interface K software FIFO 4 Universal PCI Interface...5 Ready for 64-bit System...5

Keep it Simple Timing

DK40 Datasheet & Hardware manual Version 2

TRP-C31M MODBUS TCP to RTU/ASCII Gateway

1-Port R422/485 Serial PCIe Card

SyncLink GT2/GT4 Serial Adapter

Bluetooth Serial Adapter

DECT Module UM-9802 Datasheet

Elo Interactive Digital Signage (IDS): Remote Management

1 Port FTDI USB to RS232 Null Modem Adapter

Date Rev. Details Author

Remote control circuitry via mobile phones and SMS

MODBUS over Serial Line. Specification & Implementation guide V1.0

Eliminate Risk of Contention and Data Corruption in RS-485 Communications

TTL-232R-3V3 USB to TTL Serial Converter Cable

How To Connect A Directsofl To A Powerpoint With An Acd With An Ctel With An Dm-Tel Modem On A Pc Or Ipad Or Ipa (Powerpoint) With A Powerline 2 (Powerline

How To Set Up A Modbus Cda On A Pc Or Maca (Powerline) With A Powerline (Powergen) And A Powergen (Powerbee) (Powernet) (Operating System) (Control Microsci

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

MODBUS TCP to RTU/ASCII Gateway. User s Manual

How to setup a serial Bluetooth adapter

VSCOM USB PRO Series Industrial I/O Adapters

Future Technology Devices International Ltd. USB NMC-2.5m. USB to USB Null Modem Cable. Datasheet

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

The Analyst RS422/RS232 Tester. With. VTR, Monitor, and Data Logging Option (LOG2) User Manual

UART IP Core Specification. Author: Jacob Gorban

User Manual IC-485AI

Cable Guide For all PortServer TS, Digi Connect, and Digi One Products

Cable Guide For all PortServer TS, Digi Connect, and Digi One Products

Serial Cables & Adapters

SMS based remote control system

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

Instructions on How to Use HyperTerminal to Test Serial Ports ...

Transcription:

Serial interfaces (RS232 and USB) for instrument control

Serial interface RS232 for instuments Alternative to GPIB (IEEE 488) Mainly cheap models without GPIB + Advantage: for several decades standard interface in most PCs availability - Potential problem: reimplementation to instruments with GPIB (as far as possible keeping parts of old firmware while introducing RS232) - Recently: less widely available replaced by USB)

Serial interface RS232 Original standart: EIA-RS232-C (1969) Today: more recent version of standart: EIA/TIA- RS232-F, ANSI/TIA/EIA-574, etc Original connector: 25-pin DB-25 Original use: interconnection between computer and modem (DTE and DCE) PROBLEM: frequent deviations in implementation details by individual manufacturers

RS232 DTE RS232 PSTN DCE DCE RS232 DTE DTE, Data Terminal Equipment = computer, PC DCE, Data Circuit-Termination Equipment (somatimes: Data Communicatiuon Equipment) = modem PSTN, Public Switched Telephone Network

RS232 Today variant: usually 9-pin connector DB-9 1 - CD, Carrier Detect 2 - RxD, Received Data 3 TxD, Transmitted Data 4 DTR, Data Terminal Equipment Ready 5 SG, Signal Ground 6 DSR, DCE Ready (Data Set Ready) 7 RTS (*), Request to Send 8 CTS, Clear to Send, modem signals readiness 9 RI, Ring Indicator, incoming call (*) signal 7 today usually redefined as RFR (see below) Fig.: http://www.camiresearch.com/data_com_basics/rs232_standard.html

RS232 cable interconnection a) connection DTE-DCE: cable 1:1, connector extender Use: usually: connection PC - modem rarely: PC - instrument (not typical, rare solution)

RS232 cable interconnection b) connection DTE-DTE: today much more typical SG TxD RxD TxD RxD Interconnection by crossover cable ( null modem ): Minimally: TxD -> RxD and vice versa (at least SW handshake) Usually also: CTS -> RTS (RFR) and vice versa (HW handshake) Use: PC - instrument

SW Handshake (DTE-DTE) Software hanshake: exchange of special characters Xon, Xoff - text transmission only - not for binary data (random occurrence of Xon or Xoff in data) SG TxD RxD TxD RxD Minimal implementation: 3 wires

HW Handshake (DTE-DTE) Hardware hanshake: exchange of enabling signals RTS-CTS Originally (DTE-DCE interface): request for transmission, clearance for transmission, i.e. single-sided data flow control. DTE cannot stop receiving. Today (DTE-DTE interface) redefinition of RTS signal: RFR Ready for receiving. Enables mutual data flow control. Sometimes DSR and DTR signals also used. SG TxD RxD CTS TxD RxD CTS RTS RTS Minimal implementation: 5 wires

U +15V Signal levels RS232 WARNING: inverse logic SPACE, Log. 0 +3V (receiver), +5V (transmitter) Forbidden zone -3V (receiver), -5V (transmitter) t MARK, Log. 1-15V 1 0 1 Conversion from microprocessor logic levels (TTL 0-5V): e.g. MAX232 chip, etc

Transmission in frames Quiet state -> Start bit -> N bits data -> (Parity if used) -> Stop bit(s) = Quiet state (Logic:) 1 0 1 1 Quiet Start LSB MSB Par Stop Quiet Resynchronization of receiver clock (Voltage:) + - Start LSB MSB Par Stop

Frame composition Every frame starts with 1 Start bitem (transition from quiet state to log. 0 for resynchronization of receiver clock) Follows N bits of data (typically 7 or 8, rarely other count), first the least significant bit (LSB), last the most significant bit (MSB) Follows one bit of parity (if enabled) Choice: None, Even, Odd, Mark (always 1), Space (always 0) Follows 1 (or more) Stop bits (transition back to quiet state) MUST agree frame format setting of transmitter and receiver, including data rate (Baud rate) Otherwise -> framing error reported by receiver (unexpected values measured at key control bit intervals)

Baud rate Baud rate = Symbol rate (rate of encoding impulses at physical layer) Not the same as effective data bit rate Generally (not for RS232) 1 symbol may encode multiple bits (QAM-type modulation etc ) for RS232 1 pulse = 1 bit, BUT: additional start bit, parity, stop bit(s), inter-frame delay, Standart baudartes: 75, 110, 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200

Waveform examples 9600Bd i.e. 1 bit (symbol) = 104 us, 8 bit, No Parity Character = 0x0F = 0000 1111bin = 15dec S 1 1 1 1 0 0 0 0 Stop SPACE, Log. 0 MARK, Log. 1

Waveform examples 9600Bd i.e. 1 bit (symbol) = 104 us, 8 bit, No Parity Character = 0xAA = 1010 1010bin = 170dec S 0 1 0 1 0 1 0 1 Stop SPACE, Log. 0 MARK, Log. 1

Waveform examples 2400Bd i.e. 1 bit (symbol) = 417 us, 8 bit, EVEN Parity Character = 0xFF = 1111 1111bin = 255dec S 1 1 1 1 1 1 1 1 P=0 Stop SPACE, Log. 0 MARK, Log. 1

Waveform examples 2400Bd i.e 1 bit (symbol) = 417 us, 8 bit, EVEN Parity Character = 0x01 = 0000 0001bin = 01dec S 1 0 0 0 0 0 0 0 P=1 Stop SPACE, Log. 0 MARK, Log. 1

Efforts of standartization in measurement systems IEEE 1174 standart 2000, revision 2009 BUT: Minimal real use among manufacturers Defines: HW interface: 9-pin RS232 (EIA-574) Emulation of special messages IEEE 488.1 over RS232 Implementation of IEEE 488.2 (message protocols, common commands, etc.) over RS232 Purpose: maximal protection of existing firmware in instruments using 488.2 (i.e. minimal changes enforced by migration to RS232)

IEEE 1174 IEEE 488.1 message emulation e.g.: &SRQ CRLF = Service Request &POL = Serial Poll &GET = Group Execute Trigger &DCL CRLF = Device Clear (Minimal real support of manufactureres) IEEE 488.2 support: Fig.: Standard IEEE 1174 Mainly defined solution od nonstandard situations (messgae congestion, deadlock, )

Programming RS232 communication LabView and LabWindows/CVI: Using RS232 library Using VISA library - recommended Similarly in MATLAB Instrument Control Toolbox Eventually: directly in Win32 API

Example program in CVI - RS232 Serial port setting (COM1, 9600Bd, )

Example program in CVI - VISA VISA resource: ASRL1 = COM1 Attribute settings Baudrate, N bits, Parity

USB measuring instruments Wide availability of USB in computers => Motivation for USB support in instruments Possible replacement of GPIB (IEEE 488) Faster data rate than RS232 and GPIB More devices on USB bus (127 via hubs) PROBLEM: retaining maximum of firmware in instruments (from IEEE 488.2 support) => standartization USB class Test and Measurement

USB + Data rate 1. USB 1.1 (1998): 12 Mbit/s 2. USB 2 (2000): 280 MBit/s (35 MByte/s) 3. USB 3 (2008): 4 Gbit/s First osciloscopes: USB host for USB flash discs (screenshot and data storage, replacement of floppy discs) Later: also communication and control from PC (as replacement or supplement of GPIB)

Definition of USB class Test and Measurement Device USB standart defines device classes: Audio class, Battery charging, Imaging class, IrDA, Printer Class,, Test & Measurement Class,, Video Class Purpose: retaining maximum of instrument firmware from 488.2, replacement of lower levels (488.1 -> USB) See: http://www.usb.org/developers/devclass_docs#approved

USB Discovery in PC Here: osciloscope Agilent DSO1012A Like all USB: automatic detection and driver load

VISA and USB Problem: Unlike e.g. GPIB, VISA resource descriptor for USB is higly sensitive to completeness (serial number, etc.) Thus, full specification of target device is necessary: even more than for GPIB it is good practice to make the program flexible, i.e. import the VISA resource string from GUI or a.cfg file + VISA resource can be Copy & Paste-ed from MAX + can be looked up using VISA function vifindrsrc (,"?*INSTR",,, ); Supported in VISA and integrated SW tools (NI MAX, Agilent IO Control)

Detection in NI MAX VISA resource can be Copy & Paste-ed

Tools in MAX:

Basic communication USB in MAX Identification query - Response Record in NI I/O Trace

Example program in CVI - VISA

Example program in LabView