Train Activation: Difference between revisions

From Open Rail Data Wiki
No edit summary
No edit summary
Line 18: Line 18:
There is no difference in handling Auto and Manually called trains.
There is no difference in handling Auto and Manually called trains.


== Example ==
=== Data structure ===


<tt>
==== Header ====
  "header":
  {
    "msg_type":"0001",
    "source_dev_id":"",
    "user_id":"",
    "original_data_source":"TSIA",
    "msg_queue_timestamp":"1343168357000",
    "source_system_id":"TRUST"
  },
  "body":
  {
    "schedule_source":"C",
    "train_file_address":null,
    "schedule_end_date":"2012-12-07",
    "train_id":"865B77M125",
    "tp_origin_timestamp":"2012-07-25",
    "creation_timestamp":"1343171957000",
    "tp_origin_stanox":"",
    "origin_dep_timestamp":"1343179140000",
    "train_service_code":"24676004",
    "toc_id":"84",
    "d1266_record_number":"00000",
    "train_call_type":"AUTOMATIC",
    "train_uid":"W82187",
    "train_call_mode":"NORMAL",
    "schedule_type":"O",
    "sched_origin_stanox":"86520",
    "schedule_wtt_id":"5B77M",
    "schedule_start_date":"2011-12-13"
  }
</tt>


== Important Fields ==
{|
!Field
!Description
|-
|msg_type
|Set to '0001' for an activation message
|-
|source_dev_id
|Always blank for an activation message
|-
|source_system_id
|Set to "TRUST" for an activation message
|-
|original_data_source
|Set to "TSIA" for an activation message
|}
 
==== Body ====


The fields of main significance are:


{| class="wikitable"
{|
!Field
!Description
|-
|schedule_source
|Set to 'C' for CIF schedules, or 'V' for VSTP schedules
|-
|train_file_address
|Always blank
|-
|schedule_end_date
|The end date of the schedule as per CIF or VSTP
|-
|train_id
|Set to the 10-character unique identity for this train, and will appear in other TRUST message types
|-
|tp_origin_timestamp
|?
|-
|creation_timestamp
|?
|-
|tp_origin_stanox
|STANOX of the originating location, but may be nil
|-
|origin_dep_timestamp
|Scheduled departure time
|-
|train_service_code
|Train service code as per schedule
|-
|toc_id
|Operating company ID as per [TOC_Codes]
|-
|d1266_record_number
|'00000' represents a CIF schedule, any other value indicates a VSTP schedule
|-
|train_call_type
|'AUTOMATIC' for trains which are auto-called, or 'MANUAL' for trains which are manually called (e.g. run-as-required)
|-
|train_uid
|Schedule UID being activated.  Either a letter and five numbers for a CIF schedule, or a space and five numbers for a VSTP schedule where the numbers are the same as the d1266_record_number field
|-
|train_call_mode
|Always set to 'NORMAL'
|-
|-
! Field !! Value !! Explanation
|schedule_type
|One of 'C', 'N', 'O', 'P'
|-
|-
| train_id|| 865B77M125|| train header code. provides a unique identifier for this journey. Digits 3-6 indicate the route, which can be looked up in the timetable data
|sched_origin_stanox
|STANOX of the originating location. May not be nil
|-
|-
| creation_timestamp|| 1341393780000|| The time the train was activated (Wed, 04 Jul 2012 10:23:00 +0100)
|sched_wtt_id
|Working Timetable (WTT) identifier - the train reporting number with either '1', '2', '3', '4', 'C', 'M', 'N' or 'O' appended
|-
|-
| sched_origin_stanox|| 86520|| The location where the train came online. (Southampton Central in this case)
|sched_start_date
|The start date of the schedule
|}
|}

Revision as of 10:00, 1 August 2012

Overview

The Train Activation message is used to link a 10-character unique train identity to a schedule. This unique identity is used in all other message types to refer to the train.

Unique identities are guaranteed unique only within a calendar month, as the final two digits are the day of the month in which the train ran.

Linking a schedule to a unique identity

Schedules are uniquely identified by UID, start date and STP indicator. The activation message has three fields - 'train_uid', 'schedule_start_date' and 'schedule_type'. To find the schedule that a train is running to, look these up in your timetable database.

Auto and Manual Call

Internally, the activation process is known as 'calling', and a train may be called in one of two ways:

  • The majority of schedules are set up as Auto Call. Activation messages will automatically be sent for them around an hour before the scheduled departure time.
  • Some schedules are set up as Manual Call where a train may operate more than one schedule - usually a freight train which has three timetables available with different destinations, but will only run to one specific one depending on demand on the day.

There is no difference in handling Auto and Manually called trains.

Data structure

Header

Field Description
msg_type Set to '0001' for an activation message
source_dev_id Always blank for an activation message
source_system_id Set to "TRUST" for an activation message
original_data_source Set to "TSIA" for an activation message

Body

Field Description
schedule_source Set to 'C' for CIF schedules, or 'V' for VSTP schedules
train_file_address Always blank
schedule_end_date The end date of the schedule as per CIF or VSTP
train_id Set to the 10-character unique identity for this train, and will appear in other TRUST message types
tp_origin_timestamp ?
creation_timestamp ?
tp_origin_stanox STANOX of the originating location, but may be nil
origin_dep_timestamp Scheduled departure time
train_service_code Train service code as per schedule
toc_id Operating company ID as per [TOC_Codes]
d1266_record_number '00000' represents a CIF schedule, any other value indicates a VSTP schedule
train_call_type 'AUTOMATIC' for trains which are auto-called, or 'MANUAL' for trains which are manually called (e.g. run-as-required)
train_uid Schedule UID being activated. Either a letter and five numbers for a CIF schedule, or a space and five numbers for a VSTP schedule where the numbers are the same as the d1266_record_number field
train_call_mode Always set to 'NORMAL'
schedule_type One of 'C', 'N', 'O', 'P'
sched_origin_stanox STANOX of the originating location. May not be nil
sched_wtt_id Working Timetable (WTT) identifier - the train reporting number with either '1', '2', '3', '4', 'C', 'M', 'N' or 'O' appended
sched_start_date The start date of the schedule