Difference between revisions of "Train Cancellation"

From Open Rail Data Wiki
Jump to navigation Jump to search
m
(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 has been cancelled indicated by the <code>canx_reason_code</code> field. The [[STANOX]] may represent a station or junction.
+
A train may be cancelled in one of four ways:
  
== Example ==
+
* 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")
  
<tt>
+
As with all other messages, cancellation messages will only be received for train schedules which have already been activated.
  
     "header":
+
= Data structure =
    {
+
 
         msg_type:"0002",
+
<pre>
         source_dev_id:"",
+
{
         user_id:"",
+
     "header": {
         original_data_source:"SMART",
+
         "msg_type": "0002",
         msg_queue_timestamp:"1343166976000",
+
         "source_dev_id": "",
         source_system_id:"TRUST"
+
         "user_id": "",
 +
         "original_data_source": "SDR",
 +
         "msg_queue_timestamp": "1511528427000",
 +
         "source_system_id": "TRUST"
 
     },
 
     },
     "body":
+
     "body": {
    {
+
         "train_file_address": null,
         "train_file_address":null,
+
         "train_service_code": "22721000",
         "train_service_code":"25519007",
+
         "orig_loc_stanox": "",
         "orig_loc_stanox":"",
+
         "toc_id": "88",
         "toc_id":"25",
+
         "dep_timestamp": "1511527680000",
         "dep_timestamp":"1343177760000",
+
         "division_code": "88",
         "division_code":"25",
+
         "loc_stanox": "87701",
         "loc_stanox":"74803",
+
         "canx_timestamp": "1511528400000",
         "canx_timestamp":"1343170560000",
+
         "canx_reason_code": "YI",
         "canx_reason_code":"PD",
+
         "train_id": "871B26MK24",
         "train_id":"745K96M025",
+
         "orig_loc_timestamp": "",
         "orig_loc_timestamp":"",
+
         "canx_type": "EN ROUTE"
         "canx_type":"ON CALL"
 
 
     }
 
     }
 +
}
 +
</pre>
  
</tt>
+
== Header ==
  
== Important Fields ==
+
{| class='wikitable'
 +
!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
 +
|
 +
|}
  
The fields of main significance are:
+
== Body ==
  
{| class="wikitable"
+
{| class='wikitable'
 +
!Field
 +
!Description
 
|-
 
|-
! Field !! Value !! Explanation
+
|train_file_address
 +
|The TOPS train file address, if applicable
 
|-
 
|-
| canx_timestamp|| 1343170560000|| The time the train was cancelled at the STANOX ( Tue, 24 Jul 2012 23:56:00 +0100 )
+
|train_service_code
 +
|Train service code as per the schedule
 
|-
 
|-
| 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)
+
|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
 
|-
 
|-
| 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)
+
|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 | 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 [[Train_Activation |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"
 
|-
 
|-
| canx_reason_code|| PD|| Reason for Why the Train was cancelled
 
 
|}
 
|}
 +
 +
{{Navtable-DataFeeds}}
 +
 +
[[Category:Train Movement Data]]

Revision as of 16:52, 10 December 2018

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)
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 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