implementation structure the protocol stack was implemented formerly by unicontrols, inc. under the...

1
Implementation structure The protocol stack was implemented formerly by UniControls, Inc. under the OS9 Real-Time OS. The new implementation for the VxWorks 5.4 RT OS was developed by porting the OS9 implementation under VxWorks and rewriting substantial parts of the port so they better exploit the characteristic features of the VxWorks RT OS. New features have been added to the VxWorks implementation as well: a full implementation of the network layer, better handling of hardware failures through signals and ANSI long jumps, better deadlock prevention via time-outed intertask communication mechanisms and priority inheritance. The VxWorks implementation is fully written in the C programming language and consists of 3 parts, each implementing one of the TCN application interfaces – AVI, AMI and LSI. As the AMI interface is optional and may not be used in all applications, the AMI part of the protocol stack is optional and can be excluded from the protocol stack. This saves memory in applications that use only the AVI and LSI services. A simplified structure of the VxWorks implementation of the message communication subsystem is shown on fig. 3. Apart from the OS9 implementation the interrupt handling routine was moved to a special task, the Interrupt server. This structure preserves short interrupt latencies of the VxWorks OS and provides control over the relative priority of the interrupt handler to other running tasks. Introduction On the 1 st of october 1999 the Train Communication Network (TCN) had received the status of the international standard No. IEC 61375–1. UniControls Inc., very early implemented the Wire Train Bus (WTB) that is a crucial part of the standard. The physical and link layers were implemented as the WTB2000 communication processor unit, a module for the VME-bus based PEP Modular Computers industrial computer family. The higher layers were implemented under the OS9 operating system. The Department of Control Systems Engineering FEE CTU aids in the implementation of the higher layers under the VxWorks 5.4 RT OS. open standard for communication in trains T. Pilc, P. Burget, Z. Šebek, Z. Hanzálek email: [email protected], burgetpa@…, sebek@…, hanzalek@… Department of Control Engineering Faculty of Electrical Engineering Czech Technical University knowledgments work was published with the kind agreement of UniControls Inc. work was supported by the Ministry of Education of the Czech Republic under Project VS97/03. M e sse n g e r (T h e M e sse n g e r T a sk) In terru p t P ro ce ssin g Task AMA A p plicatio n A p p lica tio n C a llb a c k fu n ction s A M A fun ctio n ca lls A M A fun ction s R e ce ive queue E ve n t q ueue S e n d queue M ID _R T P _H E A P M ID _D A TA _H E A P C a ll b lock E ve n t C o ntro l B lo ck (E CB) E ve n t C o ntro l B lo ck (E CB) D ata-O ut B uffer D ata-In B uffer F u n c tio n d ire cto ry S ta tio n d irecto ry G ro up d ire ctory D irectories W T B 2 0 0 0 u n it’s D PRAM R e a l-T im e p ro to co lta sks A M A S h a re d O bje cts U se r A p plica tion T Trnka Laboratory for Automatic Control Faculty of E lectrical E ngineering Czech Technical University Wire Train Bus Multifunction Vehicle Bus Topology linearbus ESD ,EM D :linearbus O G F:star Redundancy optional double-line optional double-line Signalling speed S S 1,0 M bit/s 1,5 M bit/s Max. propag. delay 60 s 42,7 s Max. segment length 860 m ESD :20 m EM D :200 m O G F:2 km Max seg. attenuation 20 dB ESD,EM D: 8 dB O G F: 13,8 dB Cable specification shielded and jacketed tw isted pair ESD,EM D:shielded tw isted pair O G F:glass fibre pairform ing a full- duplex point-to-pointlink Cable impedance 120,0 120,0 C able attenuation at SS 10,0 dB/km ESD,EM D: 15 dB/km O G F: 6,0 dB/km Connector 9 pin S ub-D ESD,EM D :9 pin S ub-D O G F:IEC 60874-10 (ST-bayonet) S ignal 3 ... 7 V ESD,EM D: 1,5 ... 6 V O G F: Low < -40,0 dBm H igh:-7,5 ...–4,5 dBm Encoding M anchesterN R Z M anchesterN R Z Frame format ISO /IE C 3309 Frame user data 32 ...1056 bits (4 ...132 bytes) 24 ...288 bits (3 ...36 bytes) References [1] International Standard IEC 61375-1: Electric railway equipment – Train bus, Part 1: Train Communication Network; IEC, 1999 [3] Douglas E. Comer: Internetworking With TCP/IP Volume II – Design, Implementatin, and Internals; Prentice-Hall, 1991 [4] Wind River Systems: VxWorks Programmer’s Guide 5.4, 1st ed.; Wind River Systems, 1999 [3] TCN Tutorial: http://www.labs.it/rosin/tcncorso/tutindex.htm [4] UniControls Inc.: http://www.unicontrols.cz/ Fig.1 – Train Communication Network structure The TCN standard The TCN network is not really another ”fieldbus” standard for industrial communication like CAN, PROFIBUS or INTERBUS-S although it provides common fieldbus services. The TCN is designed specially for communication in train compositions. Thanks to its relation to this field it has the following features: Hierarchical – constituted of two distinct busses, each with specific properties: the Wire Train Bus (WTB) is the communication backbone of the train, interconnecting separable parts of the train composition like the locomotive and the coaches. The Multifunction Vehicle Bus (MVB) connecting standard on-board equipment in the non-detachable parts of the train composition. Redundant – the physical layer of both WTB and MVB buses can optionally be duplicated. Failure recovery – remains partly operational in case of the failure of one or more nodes. Automatic reconfiguration – the WTB interconnecting the separable parts of the train automatically reconfigures the bus in a defined maximum time and announces the configuration change to all applications. Extendable and open – the standard treats the use of sensor busses as the third level of the TCN network and enables replacement of the WTB and/or MVB busses by other bus types under specified conditions. Both DSM and messaging supported – two communication mechanisms are supported by the bus: Process Variables, a Real-Time distributed shared memory or distributed database-like communication and Application Messages, based on sending of arbitrary length, unicast and multicast messages. Remote network management – mechanisms for managing/configuring the whole network from one place are defined. An overview of technical parameters of MVB and WTB busses can be found in tab.1. Tab.1 – WTB and MVB parameters overview Implementation Overall implementation criteria were specified based on the properties and the field of use of the TCN protocol stack. The main criteria the implementation is subject to were identified as: 1. Safety – the implementation should be able to detect and gracefully react to a hardware failure of the WTB2000 unit by notifying the application of the failure. 2. Extendibility and maintenability – the implementation should be well structured to be easy maintenable and new features and extensions can be added. 3. Memory requirements – the implementation shall have modest memory requirements Fig.2 – TCN services in the context of the ISO OSI architecture Fig.3 – Implementation of the message communication (AMI)

Upload: brook-warren

Post on 14-Dec-2015

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Implementation structure The protocol stack was implemented formerly by UniControls, Inc. under the OS9 Real-Time OS. The new implementation for the VxWorks

Implementation structureThe protocol stack was implemented formerly by UniControls, Inc. under the OS9 Real-Time OS. The new implementation for the VxWorks 5.4 RT OS was developed by porting the OS9 implementation under VxWorks and rewriting substantial parts of the port so they better exploit the characteristic features of the VxWorks RT OS.New features have been added to the VxWorks implementation as well: a full implementation of the network layer, better handling of hardware failures through signals and ANSI long jumps, better deadlock prevention via time-outed intertask communication mechanisms and priority inheritance.The VxWorks implementation is fully written in the C programming language and consists of 3 parts, each implementing one of the TCN application interfaces – AVI, AMI and LSI. As the AMI interface is optional and may not be used in all applications, the AMI part of the protocol stack is optional and can be excluded from the protocol stack. This saves memory in applications that use only the AVI and LSI services.A simplified structure of the VxWorks implementation of the message communication subsystem is shown on fig. 3. Apart from the OS9 implementation the interrupt handling routine was moved to a special task, the Interrupt server. This structure preserves short interrupt latencies of the VxWorks OS and provides control over the relative priority of the interrupt handler to other running tasks.

Introduction

On the 1st of october 1999 the Train Communication Network (TCN) had received the status of the international standard No. IEC 61375–1. UniControls Inc., very early implemented the Wire Train Bus (WTB) that is a crucial part of the standard. The physical and link layers were implemented as the WTB2000 communication processor unit, a module for the VME-bus based PEP Modular Computers industrial computer family. The higher layers were implemented under the OS9 operating system. The Department of Control Systems Engineering FEE CTU aids in the implementation of the higher layers under the VxWorks 5.4 RT OS.

An open standard for communication in trainsT. Pilc, P. Burget, Z. Šebek, Z. Hanzálek

email: [email protected], burgetpa@…, sebek@…, hanzalek@…

Department of Control EngineeringFaculty of Electrical Engineering

Czech Technical University

Acknowledgments

This work was published with the kind agreement of UniControls Inc.This work was supported by the Ministry of Education of the Czech Republic under Project VS97/03.

M essenger (The M essenger Task)In terrupt

P rocessingTask

AM AApplication

Application C allback functions

AM A function ca lls AM A functions

Rec

eive

que

ue

Eve

nt q

ueue

Sen

d qu

eue

M ID _RTP_H EAP

M ID _D ATA_H EAP

Cal

l blo

ck

Eve

nt C

ontr

ol

Blo

ck (

EC

B)

Eve

nt C

ontr

ol

Blo

ck (

EC

B)

Dat

a-O

ut

Buf

fer

Dat

a-In

Buf

fer

Function d irectory

Station d irectory

G roup d irectory

D irectories

W TB2000 un it’s D PR AM

R eal-Tim e protoco l tasks

AM A Shared O bjects

U ser Application

T

Trnka Laboratory for Automatic Control Faculty of Electrical Engineering Czech Technical University

Wire Train Bus Multifunction Vehicle Bus

Topology linear bus ESD, EMD: linear busOGF: star

Redundancy optional double-line optional double-line

Signalling speed SS 1,0 Mbit/s 1,5 Mbit/s

Max. propag. delay 60 s 42,7 s

Max. segment length 860 m ESD: 20 mEMD: 200 mOGF: 2 km

Max seg. attenuation 20 dB ESD, EMD: 8 dBOGF: 13,8 dB

Cable specification shielded and jacketed twisted pair ESD, EMD: shielded twisted pairOGF: glass fibre pair forming a full-duplex point-to-point link

Cable impedance 120,0 120,0

Cable attenuation atSS

10,0 dB/km ESD, EMD: 15 dB/kmOGF: 6,0 dB/km

Connector 9 pin Sub-D ESD, EMD: 9 pin Sub-DOGF: IEC 60874-10 (ST-bayonet)

Signal 3 ... 7 V ESD, EMD: 1,5 ... 6 VOGF: Low < -40,0 dBm

High: -7,5 ... –4,5 dBm

Encoding Manchester NRZ Manchester NRZ

Frame format ISO/IEC 3309

Frame user data 32 ... 1056 bits(4 ... 132 bytes)

24 ... 288 bits(3 ... 36 bytes)

References[1] International Standard IEC 61375-1: Electric railway equipment – Train bus,

Part 1: Train Communication Network; IEC, 1999

[3] Douglas E. Comer: Internetworking With TCP/IP Volume II – Design, Implementatin, and Internals; Prentice-Hall, 1991

[4] Wind River Systems: VxWorks Programmer’s Guide 5.4, 1st ed.;Wind River Systems, 1999

[3] TCN Tutorial: http://www.labs.it/rosin/tcncorso/tutindex.htm

[4] UniControls Inc.: http://www.unicontrols.cz/

Fig.1 – Train Communication Network structure

The TCN standard

The TCN network is not really another ”fieldbus” standard for industrial communication like CAN, PROFIBUS or INTERBUS-S although it provides common fieldbus services. The TCN is designed specially for communication in train compositions. Thanks to its relation to this field it has the following features: Hierarchical – constituted of two distinct busses, each with specific properties:

the Wire Train Bus (WTB) is the communication backbone of the train, interconnecting separable parts of the train composition like the locomotive and the coaches. The Multifunction Vehicle Bus (MVB) connecting standard on-board equipment in the non-detachable parts of the train composition.

Redundant – the physical layer of both WTB and MVB buses can optionally be duplicated. Failure recovery – remains partly operational in case of the failure of one or more nodes. Automatic reconfiguration – the WTB interconnecting the separable parts of the train

automatically reconfigures the bus in a defined maximum time and announces the configuration change to all applications.

Extendable and open – the standard treats the use of sensor busses as the third level of the TCNnetwork and enables replacement of the WTB and/or MVB busses by other bus types under specified conditions.

Both DSM and messaging supported – two communication mechanisms are supported by thebus: Process Variables, a Real-Time distributed shared memory or distributed database-like communication and Application Messages, based on sending of arbitrary length, unicast and multicast messages.

Remote network management – mechanisms for managing/configuring the whole network fromone place are defined.

An overview of technical parameters of MVB and WTB busses can be found in tab.1.

Tab.1 – WTB and MVB parameters overview

gImplementation

Overall implementation criteria were specified based on the properties and the field of use of the TCN protocol stack. The main criteria the implementation is subject to were identified as:1. Safety – the implementation should be able to detect and gracefully react to a hardware failure of

the WTB2000 unit by notifying the application of the failure.2. Extendibility and maintenability – the implementation should be well structured to be easy

maintenable and new features and extensions can be added.3. Memory requirements – the implementation shall have modest memory requirements

Fig.2 – TCN services in the context of the ISO OSI architecture

Fig.3 – Implementation of the message communication (AMI)