Difference between revisions of "Train Cancellation"

From Open Rail Data Wiki
Jump to navigation Jump to search
m (Update cancellation documentation)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
The Train Cancellation message is used to indicate a train has been cancelled indicated by the <code>canx_reason_code</code> field. The [[STANOX]] may represent a station or junction.
+
The Train Cancellation message is used to indicate a train that has been cancelled.
  
== Example ==
+
== Data structure ==
  
<tt>
+
=== Header ===
  
    "header":
+
{| class='wikitable'
    {
+
!Field
        msg_type:"0002",
+
!Description
        source_dev_id:"",
+
|-
        user_id:"",
+
|msg_type
        original_data_source:"SMART",
+
|Set to '0001' for an activation message
        msg_queue_timestamp:"1343166976000",
+
|-
        source_system_id:"TRUST"
+
|source_dev_id
    },
+
|Always blank for an activation message
    "body":
+
|-
    {
+
|source_system_id
        "train_file_address":null,
+
|Set to "TRUST" for an activation message
        "train_service_code":"25519007",
+
|-
        "orig_loc_stanox":"",
+
|original_data_source
        "toc_id":"25",
+
|Set to "TSIA" for an activation message
        "dep_timestamp":"1343177760000",
+
|}
        "division_code":"25",
 
        "loc_stanox":"74803",
 
        "canx_timestamp":"1343170560000",
 
        "canx_reason_code":"PD",
 
        "train_id":"745K96M025",
 
        "orig_loc_timestamp":"",
 
        "canx_type":"ON CALL"
 
    }
 
  
</tt>
+
=== Body ===
  
== Important Fields ==
+
{| class='wikitable'
 
+
!Field
The fields of main significance are:
+
!Description
 
+
|-
{| class="wikitable"
+
|train_id
 +
|Set to the 10-character unique identity for this train, and will appear in other TRUST message types
 +
|-
 +
|creation_timestamp
 +
|The time, in milliseconds, when the train was originally created in TRUST
 +
|-
 +
|tp_origin_timestamp
 +
|The date, in YYYY-MM-DD format, the train runs.  For trains activated before midnight that run after midnight, this date will be "tomorrow's" date
 +
|-
 +
|train_uid
 +
|The UID of the schedule being activated - either a letter and five numbers, or a space and five numbers for VSTP trains
 +
|-
 +
|sched_origin_stanox
 +
|STANOX of the originating location.  May not be nil
 +
|-
 +
|sched_start_date
 +
|The start date of the schedule
 +
|-
 +
|schedule_end_date
 +
|The end date of the schedule
 +
|-
 +
|schedule_source
 +
|Set to 'C' for schedules from CIF/ITPS, or 'V' for schedules from VSTP/TOPS
 +
|-
 +
|schedule_type
 +
|Either C (Cancellation), N (New STP), O (STP Overlay) or P (LTP)
 +
|-
 +
|sched_wtt_id
 +
|The headcode and TSPEED of the train (either '1', '2', '3', '4', 'C', 'M', 'N' or 'O')
 +
|-
 +
|d1266_record_number
 +
|Either '00000' for a CIF/ITPS schedule, or the TOPS unique ID of the schedule
 +
|-
 +
|tp_origin_stanox
 +
|If the train is due to start from a location other than the origin (i.e. it is part-cancelled), the STANOX of the location at which the train starts, otherwise the STANOX of the scheduled origin location
 
|-
 
|-
! Field !! Value !! Explanation
+
|origin_dep_timestamp
 +
|The estimated WTT time of departure from the originating location
 
|-
 
|-
| canx_timestamp|| 1343170560000|| The time the train was cancelled at the STANOX ( Tue, 24 Jul 2012 23:56:00 +0100 )
+
|train_call_type
 +
|Either 'AUTOMATIC' for auto-called trains, or 'MANUAL' for manual-called trains
 
|-
 
|-
| train_id || 745K96M025|| The Trains IDs, like a [[Train_Movement]] where the Train terminates, the Train won't likely appear on this ID again, (unless [[Train_Reinstatement]] occurs)
+
|train_call_mode
 +
|Set to 'NORMAL' for a train called normally, or 'OVERNIGHT' if the train is called as part of an overnight batch process to activate peak period trains early
 
|-
 
|-
| train_service_code|| 25519007|| schedule reference
+
|toc_id
 +
|Operating company ID as per [[TOC_Codes]]
 
|-
 
|-
| loc_stanox|| 74803|| The location of the train when the message occured. (Newbury in this case)
+
|train_service_code
 +
|Train service code as per schedule
 
|-
 
|-
| canx_reason_code|| PD|| Reason for Why the Train was cancelled
+
|train_file_address
 +
|The TOPS train file address, if applicable
 
|}
 
|}

Revision as of 15:14, 25 January 2013

Overview

The Train Cancellation message is used to indicate a train that has been cancelled.

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
train_id Set to the 10-character unique identity for this train, and will appear in other TRUST message types
creation_timestamp The time, in milliseconds, when the train was originally created in TRUST
tp_origin_timestamp The date, in YYYY-MM-DD format, the train runs. For trains activated before midnight that run after midnight, this date will be "tomorrow's" date
train_uid The UID of the schedule being activated - either a letter and five numbers, or a space and five numbers for VSTP trains
sched_origin_stanox STANOX of the originating location. May not be nil
sched_start_date The start date of the schedule
schedule_end_date The end date of the schedule
schedule_source Set to 'C' for schedules from CIF/ITPS, or 'V' for schedules from VSTP/TOPS
schedule_type Either C (Cancellation), N (New STP), O (STP Overlay) or P (LTP)
sched_wtt_id The headcode and TSPEED of the train (either '1', '2', '3', '4', 'C', 'M', 'N' or 'O')
d1266_record_number Either '00000' for a CIF/ITPS schedule, or the TOPS unique ID of the schedule
tp_origin_stanox If the train is due to start from a location other than the origin (i.e. it is part-cancelled), the STANOX of the location at which the train starts, otherwise the STANOX of the scheduled origin location
origin_dep_timestamp The estimated WTT time of departure from the originating location
train_call_type Either 'AUTOMATIC' for auto-called trains, or 'MANUAL' for manual-called trains
train_call_mode Set to 'NORMAL' for a train called normally, or 'OVERNIGHT' if the train is called as part of an overnight batch process to activate peak period trains early
toc_id Operating company ID as per TOC_Codes
train_service_code Train service code as per schedule
train_file_address The TOPS train file address, if applicable