Profibus DP Master for PC

Similar documents
Using Xbee in Serial Communication

Manual Serial PCI Cards

Lecture 4 Profibus. Urban Bilstrup Urban.Bilstrup@ide.hh.se

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

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

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

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

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

applicomio Profibus-DP

UART IP Core Specification. Author: Jacob Gorban

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

The Secrets of RS-485 Half-duplex Communication

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

Research of PROFIBUS PA s integration in PROFINET IO

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

ELAN DIGITAL SYSTEMS LTD. SL232 PC- CARD USER S GUIDE

Using the AnyBus -X Gateway to Communicate between a DVT camera and a Profibus Master

SyncLink GT2/GT4 Serial Adapter

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

1-Port R422/485 Serial PCIe Card

Cable Specifications and Information

Industrial Multi-port Serial Cards

PROFIBUS fault finding and health checking

Application Note 83 Fundamentals of RS 232 Serial Communications

PCMCIA 1 Port RS EDITION OCTOBER 1999

Bus modules systron PM

FIBER OPTIC APPLICATION IN A PROFIBUS NETWORK

BLUETOOTH SERIAL PORT PROFILE. iwrap APPLICATION NOTE

The Secrets of Flow Control in Serial Communication

Advanced Data Capture and Control Systems

PLC Support Software at Jefferson Lab

S7 for Windows S7-300/400

RS-232 COMMUNICATIONS

Programmable set for Ethernet Modbus/TCP in IP67 TI-BL67-PG-EN-2

Overview and Applications of PROFINET. Andy Verwer Verwer Training & Consultancy Ltd

White Paper. Technical Capabilities of the DF1 Half-Duplex Protocol

Why you need to monitor serial communication?

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

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

USB TO SERIAL ADAPTER

Process Control and Automation using Modbus Protocol

PROFIBUS AND MODBUS: A COMPARISON

Embedded Ethernet Interface Using Arm Processor

DECT Module UM-9802 Datasheet

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

How to design and implement firmware for embedded systems

a8251 Features General Description Programmable Communications Interface

Single channel data transceiver module WIZ2-434

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

Straton and Zenon for Advantech ADAM Copalp integrates the straton runtime into the ADAM-5550 device from Advantech

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

Tutorial.

Date Rev. Details Author

CONTROL MICROSYSTEMS DNP3. User and Reference Manual

Automation Unit TM 1703 ACP Flexible automation and telecontrol

ECE 358: Computer Networks. Homework #3. Chapter 5 and 6 Review Questions 1

Serial Communications

GE Power Controls FIELDBUS APPENDIX PROFIBUS DP. Doc. No.: ASTAT Plus PB_Appendix-v0

Analysis of Industrial PROFINET in the Task of Controlling a Dynamic System**

Siemens S7 PLC and FC 300 Profibus

RS232C < - > RS485 CONVERTER S MANUAL. Model: LD15U. Phone: / 97 / 98 (M)

Introduction to PROFIBUS and PROFINET

Bus Data Acquisition and Remote Monitoring System Using Gsm & Can

Practical steps for a successful. PROFIBUS Project. Presented by Dr. Xiu Ji Manchester Metropolitan University

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

PROFINET the Industrial Ethernet standard. Siemens AG Alle Rechte vorbehalten.

Development of a Gateway to PROFIBUS for Remote Diagnostics

User Manual. AS-Interface Programmer

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

VSCOM USB PRO Series Industrial I/O Adapters

Real-time Ethernet with TwinCAT network variables

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

Software User Guide UG-461

What You Will Learn About. Computers Are Your Future. Chapter 8. Networks: Communicating and Sharing Resources. Network Fundamentals

S-series DeviceNet Interface Card

Application Note AN_243. FT312D USB Host to UART Cable Application

Introduction. Features. Industrial 2 ports RS-422/485 with Surge PCI-Express Low Profile Serial Card

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

From Fieldbus to toreal Time Ethernet

Profinet to EDV111 Series LED Signs Siemens Function Block Software Manual

In-Vehicle Networking

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Soft PLC Research And Development System Based On PC ZHOU Wenjun 1, a

USB to serial chip CH340

USART and Asynchronous Communication

Serial Communications / Protocol in AirTest Products

SB-2000 USB Radio Interface Operating Manual CG Antenna Co. Ltd.

PROCESS AUTOMATION PLANNING AND INTEGRATION INFORMATION LB8106* Integration in Siemens SIMATIC PCS 7

Communication Unit 560CMU05 Data sheet

Configuration limits for products of the SIMATIC NET PC Software V12 SIMATIC NET. Configuration limits for products of the SIMATIC NET PC Software V12

IO-Link an integral part in the next industrial revolution known as Industry 4.0

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

Implementing MOD bus and CAN bus Protocol Conversion Interface

Bidirectional wireless communication using EmbedRF

How to setup a serial Bluetooth adapter Master Guide

Module 5. Broadcast Communication Networks. Version 2 CSE IIT, Kharagpur

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

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

Transcription:

Profibus DP Master for PC Pavel Trnka and Petr Smolík trnkap@control.felk.cvut.cz xsmolikp@control.felk.cvut.cz Department of Control Engineering Faculty of Electrical Engineering Czech Technical University in Prague Abstract. This work implements industrial network protocol Profibus DP for master devices. It is targeted to computers lacking any Profibus communication hardware support. It allows for connecting Profibus to a common PC UART or a PCI-based RS-3/485 card and makes Profibus access available under Windows NT/000/XP. Solved problems incorporated generating very short timing intervals under Windows (as short as µs), which are necessary for implementing fast communication protocols. These short intervals are achieved by writing the code as kernel device driver with maximal utilization of available hardware possibilities. Keywords: Profibus DP, Real-time in Windows, RS 485 Introduction Profibus is the most widely used communication bus (fieldbus) in the industry. This work is concerned in its variation Profibus DP (Distributed Peripherals) designed for communication between control units (like PLC or industrial computers) and distributed peripherals (sensors, actuators) over shared connection. Profibus is master-slave protocol with deterministic medium access control (stations can transmit only with permission), where one connection can be used by multiple masters and each master has granted maximum time delay for acquisition of the transmit permission. Physical layer can be based on RS 485 standard and maximal baud rate is Mbps, which is fairly high for industry bus. Stations can be of two kinds. Master stations allowed to initialize communication after receive of the permission and slave stations waiting for requests from master stations. Multiple master stations (control units) sequentially exchange permission to transmit called Token and thus forming a logical token ring. With arising use of PCs for control purposes in the industry, Profibus access is also demanded from them. So far it was necessary to have special hardware card, which was able to handle Profibus access. These cards are based on their own communication processor, customer s circuit or another hardware solution with enough power to meet high Profibus requirements. Disadvantage of these Profibus cards is their high price. This brought the motivation to make a realization of Profibus as cheap and simple as possible. To accomplish that, we made it possible to connect Profibus to standard serial port RS 3 or to simple PCI

communication card based on UART 3 circuit. Profibus DP Master is created as software implementation and special features of hardware solutions are substituted by maximal utilization of common hardware resources in PC. This was mainly possible by creating Profibus DP Master as system driver for Windows NT/000/XP. Connecting Profibus to PC RS 3 Serial Port Profibus DP hardware layer is based on RS 485, therefore to connect it to common PC RS 3 serial port we have to use interface. For simple applications (few stations, short cables) we can use simple unpowered interface (Figure ). RS-3 CN 4 R4 R 0K TxD > 47K U R-O D/R 7 8 RxD/TxD-N R6 K 3 RxD < R 0K 3 R-E 4 D-E D/R 6 3 RxD/TxD-P 4 RTS > D-I 5 CTS < 5 D 7576 R5 R3 6 DSR < 47K D7 D8 0K DZ DZ 7 D 0 DTR > 5 3 6 4 7 5 8 6 9 7 0 8 9 0 3 4 5 3 CANON-5 V+ D D D3 D4 D5 D6 V- C 0u C 0u V+ IO 78L05 I G O 3 N D VCC VCC C3 00n RS-485 CN 9 8 3 7 4 6 5 CANON-9 Fig.. Scheme of simple unpowered RS 3/485 interface. Operation of this interface is quite simple. It is powered directly from serial port and the direction of data flow is switched by RS 3 output RTS. Before transmission, RTS is set to and after completion of transmission RTS is set to 0 to allow receive of reply from the other station. This is straightforward but the problem arises when we use this interface with PC RS 3 serial port and multi-tasking environment like Windows. Simply because UART doesn t signalize the end of the transmission (silence on the bus, the moment for switching the direction) by the interrupt, but it signalize it only by the flag in one of its status byte. The problem is that we can t continuously check this flag, but we need some interrupt. The UART has interrupt only for empty transmission buffer, but it comes before the end of transmission. This was overcome by data loop-back in the interface. Direction switching is thus made after back receive of the last transmitted byte. In some special cases (timing without 3 Universal Asynchronous Receiver/Transmitter

transmitting on the bus) we use connection between data output TxD and input DSR to generate modem interrupt as a signal of the end of the transmission. PCI Serial Communication Cards Baud rates over 9.kbps are not achievable on PC RS 3 serial port, because available data rates (up to 5kbps) do not match data rates allowed by the Profibus specification []. For higher data rates we have to use communication card. In this work we used universal PCI communication card based on circuit OX6PCI954 [5] compatible with 6C950, which is able to communicate on all Profibus data rates (with proper crystal oscillator) and can generate interrupt for finished transmission. Moreover communication cards may already have RS 485 serial port. Fast Timing in Windows The important issue in implementing communication protocol is to assure proper timing according to protocol specification (correct time delays, keeping maximum possible intervals between frames, etc.), mainly because failure in timing yields to poor bus efficiency or even in its complete failure. Profibus is industrial protocol and thus stations needs real-time interaction, which relies on accurate timing. Most important timing intervals for implementing Profibus are time-outs, which are necessary for granting maximum delay before acquisition of the transmit permission. What we need for implementing these time-outs is timing mechanism with sufficiently small time resolution. Required time resolution depends on current baud rate and for high speeds (Profibus maximum is Mbps) we need very small resolution nearly µs. Concerning implementation in Windows operating system we had to find the way for reaching this short timing intervals. Operating system offers timing functions such as WaitForSingleObject, but they all depend on the same principle allowing us to reach practically not less than about 0ms. In this work we solved this problem by timing from UART interrupts, particulary interrupt signalizing empty transmission buffer. This makes it possible to achieve time resolution equivalent to the interval needed for transmitting of one byte, which is sufficient for Profibus implementation. Required interval is thus divided by the interval needed for transmitting of one byte and this yields to the number of bytes which must be transmitted before expiration of the interval. But this incorporates the problem that we need UART both for access to the bus and for timing. This is solved by data flow direction control. When we need timing without transmitting to the bus we switch the direction to receive and all transmitted bytes are sent only to closed bus transceiver without any effect on the external bus. Software Implementation Profibus DP Master is written as Windows system kernel driver. It is mainly because we need to have direct hardware access (communication with UART, use of the interrupts),

which is not available for user mode applications and is possible only in system drivers. Next advantage of realization as a driver is easier bus access for the user, because DP Master as a driver is integrated into the operating system. Higher DP-Master Layers FDL Application... FDL Application n API FDL Layers ProfiM API (Siemens compatible) Kernel Driver SAP List Configuration GAP List Watchdog Requests Queue FDL Layer State Machine Results Queue Tx/Rx Control Timing UART Interrupt Hardware dependent driver layer Hardware Profibus Network Fig.. Profibus DP Master Block Diagram From the structure of DP Master in Figure we can see that the driver running in kernel mode is divided in two parts. The first one is hardware dependent and directly controls UART circuit providing bus access (data flow direction control) and fast timing for higher layers. This is the only part, which has to be updated to allow driver to use a new hardware for Profibus access. Current version can use standard RS 3 serial port and PCI cards based on OX6PCI954 circuit. The second part is hardware independent implementing DP Master and communication protocol and is included in the driver only to assure fast communication with lower layer to achieve fast access to the hardware. The last part of DP Master is a static library linked to the programs using Profibus. This library provide program s access to the driver and Siemens compatible Profibus FDL API [4].

Fig. 3. Relation between CPU load and baud rate (measured on PC with AMD Athlon 600+ using universal serial communication card Tedia PCI-48 based on circuit OX6PCI954) Practical Results This work brings large simplification to the hardware required for Profibus access. On the other side the software realization increases CPU load in relation to baud rate as can be seen in Figure 3. This limits the usability of the software realization. In our case and on our testing machine the practical limit was.5mbps (AMD Athlon 600+ with universal serial communication card Tedia PCI-48 based on circuit OX6PCI954). Conclusion This work tried to bring the solution demanded from the Profibus community. The effort was successful and the result can be used even for high transfer data rates in applications, which are not explicitly time critical. This was mainly possible by creating Profibus DP Master as system driver for Windows NT/000/XP. Moreover application interface is compatible with solutions from Siemens company, which allows for simple replacement. References. ONEY, WALTER. Programming the Microsoft Windows Driver Model. Second Edition. Microsoft Press, 00. 800 p. ISBN 07-356-803-8.. PROFIBUS Specification. Edition.0. Karlsruhe: PROFIBUS International, 997. 94 p. European Standard EN 50 70. 3. TRNKA, Pavel. Profibus DP Master pro PC. Master Thesis. Prague: Czech Technical University, Faculty of Electrical Engineering, Department of Control Engineering, 004. 70 p. URL:<http://dce.felk.cvut.cz/dolezilkova/diplomky> 4. FDL Programming Interface. Release 4. Karlsruhe: Siemens AG, 995. 6 p. 5. OX6PCI954 Data Sheet. Revision.3. Oxfordshire: Oxford Semiconductor LTD., 999. 7 p. URL: <http://www.oxsemi.com>