Train Cancellation: Difference between revisions

From Open Rail Data Wiki
m Update cancellation documentation
Add details that the train_id does not alter on a change of identity
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Overview ==
A cancellation message is sent when the train does not, or will not, complete its scheduled journey.


The Train Cancellation message is used to indicate a train that has been cancelled.
A train may be cancelled in one of four ways:


== Data structure ==
* At activation time ("ON CALL"), usually where the applicable schedule has a STP indicator of "C" - see [[Planned Cancellations]].  Trains may be cancelled for other reasons before train has been activated, and when activation occurs, the train will be immediately cancelled with the appropriate reason code
* At the train's planned origin ("AT ORIGIN")
* En-route ("EN ROUTE")
* Off-route ("OUT OF PLAN")


=== Header ===
As with all other messages, cancellation messages will only be received for train schedules which have already been activated.
 
= Data structure =
 
<pre>
{
    "header": {
        "msg_type": "0002",
        "source_dev_id": "",
        "user_id": "",
        "original_data_source": "SDR",
        "msg_queue_timestamp": "1511528427000",
        "source_system_id": "TRUST"
    },
    "body": {
        "train_file_address": null,
        "train_service_code": "22721000",
        "orig_loc_stanox": "",
        "toc_id": "88",
        "dep_timestamp": "1511527680000",
        "division_code": "88",
        "loc_stanox": "87701",
        "canx_timestamp": "1511528400000",
        "canx_reason_code": "YI",
        "train_id": "871B26MK24",
        "orig_loc_timestamp": "",
        "canx_type": "EN ROUTE"
    }
}
</pre>
 
== Header ==


{| class='wikitable'
{| class='wikitable'
Line 12: Line 46:
|-
|-
|msg_type
|msg_type
|Set to '0001' for an activation message
|Set to '0002' for a cancellation message
|-
|-
|source_dev_id
|source_dev_id
|Always blank for an activation message
|[[LATA]] or [[CICS Session]] of the inputting terminal
|-
|user_id
|[[NCI signon]] of the inputting user
|-
|-
|source_system_id
|source_system_id
|Set to "TRUST" for an activation message
|Set to "TRUST" for a cancellation message
|-
|-
|original_data_source
|original_data_source
|Set to "TSIA" for an activation message
|Set to "TOPS" or "SDR" for a reactionary cancellation, or "" for a planned cancellation (STP 'C')
|-
|msg_queue_timestamp
|
|}
|}


=== Body ===
== Body ==


{| class='wikitable'
{| class='wikitable'
Line 30: Line 70:
!Description
!Description
|-
|-
|train_id
|train_file_address
|Set to the 10-character unique identity for this train, and will appear in other TRUST message types
|The TOPS train file address, if applicable
|-
|-
|creation_timestamp
|train_service_code
|The time, in milliseconds, when the train was originally created in TRUST
|Train service code as per the schedule
|-
|-
|tp_origin_timestamp
|orig_loc_stanox
|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
|For an an "OUT OF PLAN" cancellation, this is the location that the train should have been at according to the schedule
|-
|-
|train_uid
|toc_id
|The UID of the schedule being activated - either a letter and five numbers, or a space and five numbers for VSTP trains
|Operating company ID as per [[TOC Codes]]
|-
|-
|sched_origin_stanox
|dep_timestamp
|STANOX of the originating location.  May not be nil
|The departure time at the location that the train is cancelled from (in milliseconds since the UNIX epoch)
|-
|-
|sched_start_date
|division_code
|The start date of the schedule
|Operating company ID as per [[TOC Codes]]
|-
|-
|schedule_end_date
|loc_stanox
|The end date of the schedule
|The STANOX of the location that the train is being cancelled from.  For an "OUT OF PLAN" cancellation, this STANOX will not be in the schedule, but a [[Train_Movement | Train Movement]] message will have already been sent.
|-
|-
|schedule_source
|canx_timestamp
|Set to 'C' for schedules from CIF/ITPS, or 'V' for schedules from VSTP/TOPS
|The time at which the cancellation was input to TRUST
|-
|-
|schedule_type
|canx_reason_code
|Either C (Cancellation), N (New STP), O (STP Overlay) or P (LTP)
|The reason code for the cancellation, taken from the [[Delay Attribution Guide]]
|-
|-
|sched_wtt_id
|train_id
|The headcode and TSPEED of the train (either '1', '2', '3', '4', 'C', 'M', 'N' or 'O')
|The 10-character unique identity for this train (sent in the TRUST [[Train_Activation |activation message]]). If a [[Change_of_Identity|change of identity]] occurs, this will still continue to be the original train_id from the activation message.
|-
|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
|orig_loc_timestamp
|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
|For an "OUT OF PLAN" cancellation, this is the departure time of the location that the train should have been at according to the schedule
|-
|-
|toc_id
|canx_type
|Operating company ID as per [[TOC_Codes]]
|Either "ON CALL" for a planned cancellation, "AT ORIGIN", "EN ROUTE" or "OUT OF PLAN"
|-
|-
|train_service_code
|Train service code as per schedule
|-
|train_file_address
|The TOPS train file address, if applicable
|}
|}
{{Navtable-DataFeeds}}
[[Category:Train Movement Data]]

Latest revision as of 13:58, 4 November 2019

A cancellation message is sent when the train does not, or will not, complete its scheduled journey.

A train may be cancelled in one of four ways:

  • At activation time ("ON CALL"), usually where the applicable schedule has a STP indicator of "C" - see Planned Cancellations. Trains may be cancelled for other reasons before train has been activated, and when activation occurs, the train will be immediately cancelled with the appropriate reason code
  • At the train's planned origin ("AT ORIGIN")
  • En-route ("EN ROUTE")
  • Off-route ("OUT OF PLAN")

As with all other messages, cancellation messages will only be received for train schedules which have already been activated.

Data structure

{
    "header": {
        "msg_type": "0002",
        "source_dev_id": "",
        "user_id": "",
        "original_data_source": "SDR",
        "msg_queue_timestamp": "1511528427000",
        "source_system_id": "TRUST"
    },
    "body": {
        "train_file_address": null,
        "train_service_code": "22721000",
        "orig_loc_stanox": "",
        "toc_id": "88",
        "dep_timestamp": "1511527680000",
        "division_code": "88",
        "loc_stanox": "87701",
        "canx_timestamp": "1511528400000",
        "canx_reason_code": "YI",
        "train_id": "871B26MK24",
        "orig_loc_timestamp": "",
        "canx_type": "EN ROUTE"
    }
}

Header

Field Description
msg_type Set to '0002' for a cancellation message
source_dev_id LATA or CICS Session of the inputting terminal
user_id NCI signon of the inputting user
source_system_id Set to "TRUST" for a cancellation message
original_data_source Set to "TOPS" or "SDR" for a reactionary cancellation, or "" for a planned cancellation (STP 'C')
msg_queue_timestamp

Body

Field Description
train_file_address The TOPS train file address, if applicable
train_service_code Train service code as per the schedule
orig_loc_stanox For an an "OUT OF PLAN" cancellation, this is the location that the train should have been at according to the schedule
toc_id Operating company ID as per TOC Codes
dep_timestamp The departure time at the location that the train is cancelled from (in milliseconds since the UNIX epoch)
division_code Operating company ID as per TOC Codes
loc_stanox The STANOX of the location that the train is being cancelled from. For an "OUT OF PLAN" cancellation, this STANOX will not be in the schedule, but a Train Movement message will have already been sent.
canx_timestamp The time at which the cancellation was input to TRUST
canx_reason_code The reason code for the cancellation, taken from the Delay Attribution Guide
train_id The 10-character unique identity for this train (sent in the TRUST activation message). If a change of identity occurs, this will still continue to be the original train_id from the activation message.
orig_loc_timestamp For an "OUT OF PLAN" cancellation, this is the departure time of the location that the train should have been at according to the schedule
canx_type Either "ON CALL" for a planned cancellation, "AT ORIGIN", "EN ROUTE" or "OUT OF PLAN"


Network Rail Open Data Feeds
Data Feeds About the Feeds Account States Durable Subscriptions Example Code ( PHP / C# / Java / Ruby / Node.js) • Advanced UsesFAQ Release Notes
RTPPM RTPPM Feed
Train Movements Train Movements Feed Train Activation Train Cancellation Train Movement Train Reinstatement Change of Origin Change of Identity Change of Location TSPEED Field Planned Cancellations Cancellation Codes
TD TD Feed C-Class Messages S-Class Messages Train Describers TD Berths
VSTP VSTP Feed
TSR TSR Feed Route Codes
SCHEDULE SCHEDULE Feed TIPLOC Records Schedule and Location Records Association Records CIF Codes How Scheduling Works Allowances
Reference Data Reference Data Feed TOC Codes CIF Codes Delay Attribution Codes Identifying Locations (STANOX, TIPLOC, NLC and 3-Alpha Codes) STANOX Geographical Areas Train Planning data (BPLAN)