Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and...

44
Real-Time Protocols 1 IEC Train Communication Network IEC 61375 - Clause 2 1999 December, HK Train Communication Network IEC 61375 - 2 Real Time Protocols Process Variables

Transcript of Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and...

Page 1: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

1 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Train Communication Network

IEC 61375 - 2

Real Time Protocols

Process Variables

Page 2: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

2 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Real-Time Protocols

1. General Principles

2. Variables

3. Messages

1. Principle of Message Data communication

5. Software structure

2. Link Layer Interface

4. Transport protocol

3. Networking and Routing

1. Principle of cyclic Process Data broadcast

2. Traffic Stores principle and implementation

3. Process Variables and Datasets

4. Software structure

5. Application Layer Interface for Process Variables

6. Networking

6. Application Interface

Page 3: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

3 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

TCN Data Traffic

Periodic Transmission

short and urgent data items carrying the trains's state

Since variables are refreshed periodically, there is no need for a retransmission protocol in case of transmission error.

Two traffics share the same bus:

periodic

phase periodic

phase

event

sporadic phase

sporadic phase

time

Sporadic Transmission

infrequent, sometimes lengthy messages reporting events, for:

• System: initialisation, down-loading, ...

Since messages represent state changes, they may not get lost

a protocol recovers transmission errors.

• Users: diagnostics, status

basic period basic period

Process Data Message Data

... motor current, axle speed, operator's commands,...

Page 4: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

4 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Application Sight Of Communication

R4

Traffic Store

(Process Data

Base)

Periodical Tasks

R3 R2 R1

Message Data (destination-oriented)

Process Data (Broadcast)

E3 E2 E1

Event-driven Tasks

bus

Supervisory

Data

bus controller

Message Services Variables Services

Queues

station

Page 5: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

5 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Principle of Cyclic Source-Addressed Broadcast

1. General Principles

2. Variables

3. Messages

1. Principle of Message Data communication

5. Software structure

2. Link Layer Interface

4. Transport protocol

3. Networking and Routing

1. Principle of cyclic source-addressed broadcast

2. Traffic Stores principle and implementation

3. Process Variables and Datasets

4. Software structure

5. Application Layer Interface for Process Variables

6. Networking

6. Application Interface

Page 6: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

6 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Cyclic Data Transfer

1 2 3 4

Individual period

1 2 3 4 5 1 2 3 4 5 6

2 · Tpd

6

N participants

time [µs] read transfer

time [ms]

The duration of each poll is the sum of the transmission time of address and

data (bit-rate dependent)

and of the reply delay of the signals

(independent of bit-rate).

The master polls addresses in a fixed sequence, according to its Poll List.

Address

(4) Data

(4) Address

(5) 10 µs/km

Address

devices bus master

plant

1 2 3 4 5 6

Poll

List

Page 7: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

7 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Cyclic Operation

Their delivery delay (refresh rate) is deterministic and constant.

There is no need for error recovery since a fresh value will be transmitted in the next cycle.

Only states may be transmitted, not state changes.

To keep a low poll time, only small data items may be transmitted (<256 bits)

Cyclic operation is used to transmit the state variables of the train.

Periodically transmitted state variables are called Periodic Data.

The bus is under control of a central master.

Periodic Data are transmitted at fixed intervals , whether they changed or not.

The cycle time is limited by the product of the number of data transmitted by the duration of each poll.

(e.g. 100 µs /point, 100 points => 10 ms)

Page 8: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

8 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Optimizing Cyclical Operation

time

4a 8 16 1 4b 64 3

1 ms period

(basic period)

2 ms period

2 4a

4 ms period

1 ms 1 ms

1 1 1

group with

period 1ms

2

Solution : introduce subcycles for less urgent data:

Cyclic operation uses a fixed portion of the bus's time

The response time slows down accordingly

Cyclic polling need tools to configure the poll cycles.

Poll cycles should not be modified at run-time (source of non-determinism)

The poll period increases with the number of polled items

Page 9: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

9 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Subscription Principle

The application accesses them in the same way as a process database.

The bus becomes an on-line data base.

Each station monitors the bus and snoops the variables it is interested in .

Each station needs an associative memory to recognize its variables.

A device exports many process data (state variables) with different priorities.

If there were only one poll type per device, a device should be polled at the frequency required by its highest-priority data.

Rather than poll a device, the master polls the process data.

Each device is subscribed as source or as sink for a number of process data. Only one device may be source of a certain process data (collision).

The replicated traffic stores can be considered as "caches" of the plant state.

Page 10: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

10 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Process Data Transmission

The device which sources that variable responds with a slave frame containing the value, all devices subscribed as sink receive that frame.

The bus master broadcasts the identifier of a variable to be transmitted: Phase1:

Phase 2:

devices

(slaves)

BUS MASTER

BUS

subscribed devices subscribed

device subscribed

device

source sink sink sink

variable value

Process Data are transmitted by source-addressed broadcast :

BUS

variable identifier

BUS MASTER devices

(slaves) source sink sink

subscribed devices

sink

subscribed device

subscribed device

Page 11: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

11 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Traffic Stores

Bus and applications interface through a shared memory, the traffic store.

The bus master scans the identifiers at its own pace.

The bus traffic and the application cycles are asynchronous to each other.

cyclic algorithms

cyclic algorithms

cyclic algorithms

cyclic algorithms

port address

application

1

Traffic

Stores

Ports Ports Ports

application

2 application

4

source

port

sink

port

port data

bus controller

bus controller

bus controller

sink

port

cyclic poll

bus controller

bus

master

application

3

bus controller

bus

Periodic

List

Ports

Page 12: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

12 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Traffic Stores

1. General Principles

2. Variables

3. Messages

1. Principle of Message Data communication

5. Software structure

2. Link Layer Interface

4. Transport protocol

3. Networking and Routing

1. Principle of cyclic Process Data broadcast

2. Traffic Stores principle and implementation

3. Process Variables and Datasets

4. Software structure

5. Application Layer Interface for Process Variables

6. Networking

6. Application Interface

Page 13: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

13 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

MVB Traffic Store Implementation

4096

entries

port index

port index table

port control

& status ports

odd page

ports

even page

Page0 Page1 PCS

1 2 3 4 5 6 7 8 9

...

0

9

unused = 0

1234

4095

0

255

4 octets 8 octets 8 octets

trash trash

256 docks

x 8 octets

= 2K octets

256 docks

x 8 octets

= 2K octets

256 PCS

x 4 octets

= 1K octets

4K ports

x 1 octet

= 4K octets

dock2

dock4

dock8

12-bit port address

Page 14: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

14 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

MVB Traffic Store, Ports And Docks

The former contents of a Port is overwritten (buffered, not queued).

Traffic stores are divided into Ports, each •Port corresponding to one identifier

To provide simultaneous and consistent access by either application or bus,

each Port is stored in two independent pages, written alternately.

The PCS performs additional functions like freshness supervision and

interrupt generation.

The Port Index Table forms an associative memory, which indicates for each identifier if it is subscribed to that device, by pointing to the PCS.

A device has normally a small number of Ports (e.g. 256), but a supervisory

device may have the full range of 4096 Ports.

Its Port Control and Status register indicates if a Port is source or sink.

A Port may be up to 1024 bit wide (256bits on the MVB)

A Port is divided into Docks of 32 bits for better memory usage.

Page 15: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

15 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Freshness Supervision

Process Data are not retransmitted explicitely in case of transmission error,

they will be retransmitted anyhow at the next poll.

The application must tolerate an occasional loss of data.

To protect the application from using obsolete data, each Port in the traffic store has a freshness counter.

This counter is reset by writing to that Port. It is incremented regularly, either by the application processor (BAP) or by the bus controller (MVBC).

The application should always read the value of the counter before using the Port data and compare it with its tolerance level.

The freshness supervision is evaluated by each reader independently, some readers may be more tolerant than others.

Bus error interrupts in case of severe disturbances are not directed to the application, but to the device management.

Page 16: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

16 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Implementation of Port Control And Status (BAP controller)

TMP SRC SINK

Port

Active

Sink

Port

Active

Source

Store

Check

Octet

function code (size)

IE0 IE1

Enable

Interrupt

Event 1

Enable

Interrupt

3

IE3 IE2

STO TERR

Slave

TimeOut Transfer

Error Valid

Page

VP BNI

Bus Not

Idle

T0 T1

sink time supervision counter

T7

Enable

Interrupt

Event 0

T2 T3 T4 T5 T6

reserved

Enable

Interrupt

2

unused

size in 16 bit words

The PCS depends both on the traffic store and on the bus controller

Page 17: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

17 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Traffic Store Access Restriction

page 1 becomes valid

t2 t1

writer

reader 1

page0

page1

(slow) reader 2

page 0 becomes valid

time

• there may be only one writer for a port, but several readers

• a reader must read the whole port before the writer overwrites it again

• there may be no semaphores to guard access to a traffic store (real-time)

traffic store

starts ends

error !

• therefore, the processor must read ports with interrupt off.

• this time is equal to the basic period in the worst case ( 1ms)

Page 18: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

18 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Process Variables And Datasets

1. General Principles

2. Variables

3. Messages

1. Principle of Message Data communication

5. Software structure

2. Link Layer Interface

4. Transport protocol

3. Networking and Routing

1. Principle of cyclic Process Data broadcast

2. Traffic Stores principle and implementation

3. Process Variables and Datasets

4. Software structure

5. Application Layer Interface for Process Variables

6. Networking

6. Application Interface

Page 19: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

19 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Datasets

It is economical to transport several variables in the same frame as a dataset.

wheel

speed air

pressure line

voltage motor

current

analog variables

Dataset

binary variables

all door closed lights on

heat on

air condition on

bit offset

16 32 48 0 64 66 70

size

A variable is identified within a dataset by its offset and its size

A dataset is treated as a whole for communication and access.

Variables may be of different types, types can be mixed.

Page 20: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

20 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Variable Types

Data representation may be different according to the processor

(e.g. Intel's Little-Endians and Motorola's Big-Endians)

However, there may be no ambiguity on the bus

Therefore, each transmitted variable has a defined type associated with it.

This type is agreed beforehand between the applications during configuration

To guarantee consistency, the type of the variable is part of the variable's name

TCN specifies a number of standard network variable types.

The format obeys to the Big-Endian convention (most significant first)

Page 21: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

21 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Predefined Variable Types

ANTIVALENT2 10= forced 00 = network error

01 = ok 11 = data undefined

BITSETn (array of n boolean)

INTEGERn (2's complement) SB

UNSIGNEDn

FRACTIONALn SB 2 0

REAL32 (IEEE) exponent

mantissa

ARRAY n OF CHARACTER8 char 0 char 1

SB

SB = sign bit

TIMEDATE48...

Application data types have been defined in ROSIN

BOOLEAN1 0 = FALSE

1 = TRUE

Page 22: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

22 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Configuration Change And Errors

Reconfiguring the whole bus to include new variables is normally not allowed in a running project, since this can affect the time behaviour of all applications.

E.g. in the Train Bus, old coaches cannot be modified to consider new variables.

It also may be that a variable is invalid when produced, e.g. by a defective unit. The producer may not modify the structure of data sets to exclude failed data

Mechanisms are provided to protect against production and transmission errors:

Freshness Supervision at reception

Check Variable: production supervision

Dedicated variables (Lifesigns) let all devices monitor the other's health

Page 23: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

23 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Check Variable

TCN does not rely on a source freshness supervision

TCN relies on the invalidation of stale data at the source through a check variable:

Traffic Store

source port

Traffic Store

freshness check set to 00 if

stale or wrong

value check value

sink port

check value

subscriber application publisher application

Page 24: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

24 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Variable Extension And Invalidation

To allow later extension, room is left in the datasets for additional variables. Since the type of these future data is unknown, unused fields are filled with '1".

To signal that a variable is invalid, the producer overwrites the variable with "0".

Since both an "all 1" and an "all 0" word can be a meaningful combination, each

variable can be supervised by a check variable, of type ANTIVALENT2:

0 1 0 1 1 1 0 0 0 1

check

0 0 0 0 0 0 0 0

1 1 1 1 1 1 1 1

0 0

1 1

correct variable

error

undefined

variable value

A variable and its check variable are treated indivisibly when reading or writing

The check variable may be located anywhere in the same data set.

Dataset

var_offset chk_offset

10 = forced

00 = network error 01 = ok

11 = data undefined

Page 25: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

25 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Example: Train Bus Frames Extension

40 octets 40 octets

1992 free free 1992

Vehicle Status Traction Status Cab Commands

48 octets

1992 free locomotive with attended cab

1992 free coach (no cab, no traction)

1992 free 1992 free motor coach

(no cab)

1992 free free steering coach with attended cab

free 1992

1992 free free 1992 1992 free locomotive with unattended cab

1992 free free unattended steering coach

free

1995

1995

old vehicles understand the new vehicle's 1992 data and ignore 1995 variables.

new vehicles understand the old vehicle's 1992 data and ignore undefined fields.

Page 26: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

26 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

PV_Name

dataset identifier

port address size variable offset type check offset

4 12 6 10 6 10

traffic store

port address traffic

store

size bit_offset

type check_offset

n

n+2

n+4

this is how it look in memory,

independently if the processor is little-endian or big-endian.

Each Process Variable is identified by a unique PV_Name

(DS-Name)

To each variable, the application associates a value location and a check location

Sink variables have in addition the freshness argument

PV_Name

Page 27: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

27 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Scope Of The PV-name

application

B application

A

1234 8

port

bus

offset

process data frame (dataset)

application

C

3 1234 8

offset dataset traffic

store

1 1234 8

offset dataset traffic

store

1234

traffic store1 traffic store2 traffic store3 traffic store1

the port identifier and the offset within the port

identifies a variable within a bus or within a traffic store

device x device y

Page 28: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

28 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Process Variables Instances

subscribers

application

instances

device device

device

traffic store instance

publisher

application instance

bus instance

applications

There exist a number of (inconsistent) instances of the same Process Variable

bus

Page 29: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

29 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Software Structure For Process Variables

1. General Principles

2. Variables

3. Messages

1. Principle of Message Data Communication

5. Software structure

2. Link Layer Interface

4. Transport protocol

3. Networking and Routing

1. Principle of cyclic Process Data broadcast

2. Traffic Stores principle and implementation

3. Process Variables and Datasets

4. Software structure

5. Application Layer Interface for Process Variables

6. Networking

6. Application Interface

Page 30: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

30 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Application Access To Process Variables

Application Interface

ap_

Link Interface

lp_

Traffic Store

Application Process

bus

controller

bus

Link Process

APA AVA

PTA

Application

Program

dataset with

a variable, its check

variable and its freshness counter

applications access the traffic store directly, as a shared memory.

(there may be only writer for a given port)

Page 31: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

31 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Several Applications, One Traffic Store

APA AVA

PTA

Application

Program

bus

Link Process

APA AVA

PTA

Application

Program

APA AVA

PTA

Application

Program

Traffic

Store

same process

bus

controller

several processes may access the traffic store in parallel

Page 32: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

32 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

One Application, Several Traffic Stores

Link 1

Bus 1 Bus 2

Application Interface ap_

Link Interface lp_

traffic

store

2

Link 2 link

process 2 link

process 1

APA AVA

PTA2

Application

Program

PTA1

traffic

store

1

Page 33: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

33 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Access To Several Traffic Stores

traffic store

port index table 2

port index table 5 page 1 PCS

port

traffic store

descriptor

page 0 page 1 PCS

var_offset

MVB

WTB

traffic store

index

PV_Name typesize

page 0

Page 34: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

34 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Forcing

Port Index Table

substitute ports

odd ports

mask ports

even ports

get/put force bus

if a source variable is forced, its substitute value is copied to the bus and to every (local) application which reads it

if a sink variable is forced, its substitute value is read by local applications, remote appplications are not affected

Variables can be forced individually for debugging and commissioning

Page 35: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

35 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Forcing Operation

Mask Port

Substitute Port

port offset

1

1 0 1 0 1 0 1 0

Even Traffic Port x

Odd Traffic Port 1 1 1 1 1 0 1 1

1 0

1

0

0

1 1 1 1 1 0 1 0 x x x x x x x

x x x x x x x x

x x x x x x x x x x x x x x x x x x x

1 1 0 1 0

1 1 0 1 0 1 0 1 0 1 0

1 0 1 0 1 0

1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0

1234:6

1234:21

For each bit set to 0 in the Mask Port, the corresponding bit of the Substitute

port is copied to the variable location

analog

binary

Page 36: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

36 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Application Interface For Process Variables

1. General Principles

2. Variables

3. Messages

1. Principle of Message Data communication

5. Software structure

2. Link Layer Interface

4. Transport protocol

3. Networking and Routing

1. Principle of cyclic Process Data broadcast

2. Traffic Stores principle and implementation

3. Process Variables and Datasets

4. Software structure

5. Application Layer Interface for Process Variables

6. Networking

6. Application Interface

Page 37: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

37 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

AVA Procedures

apd_put_variable (pv_name, producer) apd_get_variable (pv_name, consumer, check)

individual access

apd_force_variable (pv_name, substitute) apd_unforce_variable (pv_name) apd_unforce_all

ap_put_cluster (pv_list) ap_get_cluster (pv_list)

cluster access

dataset access (link layer) ds_received (ds_name) ds_sent (ds_name) ds_subscribe_sent (ds_name, sent_ind) ds_subscribe_received (ds_name, received_ind)

apd_init

read a variable write a variable

force a variable to a value restore bus communication same for all variables initialize traffic store

read a cluster of variables write a cluster of variables

signals reception of dataset signals emission of dataset

corresponding subscriptions

ap_put_set (pv_list) ap_get_set (pv_list)

pv-set access read a set of variables write a set of variables

Page 38: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

38 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Individual Access

traff

ic s

tore

bus transfer ( triggered by master)

sink port

source port

apd_put_var

local p-instance

apd_force

publisher

application substitute local

s-instance

subscriber

application substitute

apd_unforce

apd_get_var lp_init

apd_force

apd_unforce

traff

ic s

tore

apd_put_variable apd_force_variable

apd_get_variable apd_unforce_variable

sink port

Variable may be accessed individually, together with their check variable

Variable may be forced individually to a certain value (for test purpose)

lp_init

Page 39: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

39 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Individual Access Procedures

struct STR_ APD_PV_NAME

(TYPE_APD_PV_NAME)

(pv_format)

(ds_name) size val-offset

prt_addr ts_id

type chk-offset

struct STR_ APD_PV_DESCRIPTOR

(TYPE_APD_PV_DESCRIPTOR)

size val-offset

prt_addr ts_id

type chk-offset

p_var

(void *)

p_chk

(void *)

(APD_PV_NAME)

data structures

TYPE_APD_RESULT apd_get_variable( const struct STR_PV_DESCRIPTOR* var, unsigned short* fresh)

example:

my_result = apd_get_variable( &apd_cpu1_b1, &frs_cpu1_t1)

TYPE_APD_RESULT apd_put_variable( const struct STR_PV_DESCRIPTOR* var)

points to variable

points to checker

procedures

Page 40: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

40 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Cluster Access Procedures

Traffic Store Traffic Store

bus transfer

export

cluster list

local

output

variable

publisher

application

loc_adr PV

local

input

variable

subscriber

application

sink port source port

apd_get_cluster

apd_get_set

APA APA

It is fast and convenient to access groups of variables, from different ports.

loc_adr PV

import

cluster list

apd_put_cluster

apd_put_set

Page 41: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

41 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

PV_Set

A PV_set groups variables of the same port

struct STR_ APD_PV_DESCRIPTOR

(TYPE_APD_PV_DESCRIPTOR)

size val-offset

prt_addr ts_id

type chk-offset

p_var

(void *)

p_chk

(void *)

(APD_PV_NAME)

TYPE_APD_RESULT apd_get_set(

const struct STR_PV_DESCRIPTOR* pvset,

unsigned short* fresh,

int nr_variables)

example:

my_result = apd_get_set( &ads_cpu1_t1, &frs_cpu1_t1, 5)

TYPE_APD_RESULT apd_put_set( const struct STR_PV_DESCRIPTOR* pvset, int nr_variables)

procedures

data structures

array of pv_descriptors

Page 42: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

42 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Dataset Access Procedures

struct STR_ APD_DS_NAME

(TYPE_APD_DS_NAME)

prt_addr ts_id for refresh timer

To supervise their freshness, data sets are grouped in a time-out set

array of dataset identifiers

With the BAP, the set must be explicitely refreshed.

This operation is not needed anymore with the MVBC.

Page 43: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

43 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Synchronization

Ports of a traffic stores can be configured to raise an interrupt when addressed for sending or for receiving.

This feature is not intended to transmit Process Data by events, but to

synchronize applications, e.g. for time distribution.

The same mechanism is used for message data

To this purpose, an application subscribes a procedure to the bus, which will be

called when the port is written (or read).

apd_subscribe

apd_desubscribe

apd_pass_subscription

DS_NAME DS_NAME DS_NAME

Page 44: Train Communication Network IEC 61375 - 2 Real Time Protocols · Traffic Stores principle and implementation 3. Process Variables and Datasets 4. ... VP BNI Bus Not T1 T0 sink time

Real-Time Protocols

44 IEC Train Communication Network IEC 61375 - Clause 2

1999 December, HK

Process Data Networking

gateway filters & forwards Process Data

= application-dependent

marshalling

The total delay is the sum of 5 delays:

2 gateway delays

and 3 bus delays

All busses operate cyclically.

gateway

T1 frame

T2 frame

cyclic train bus process data frames

speed

stop

speed

stop

Vehicle Bus Vehicle Bus

Train Bus

cyclic

po

lling

cyclic

po

lling

from T1

from T2

gateway

import

list

sink ports source ports

export

list import

list export

list

sink ports source ports

sink ports source ports

sink ports source ports