There will be an instance of this SCChart for each train. The train gets a pre-calculated path and the direction for each track in the path (forward or reverse). Once the path is loaded it selects a small portion of it, that allows the train to drive and the environment to keep track of it. The portion is then outputted combined with the wanted track speed.

Inputs

Name

Type

Length

Description

in_aiPath

int array

PATH_LENGHT

The path containing all track numbers in correct order from start to finish. The end of the path is specified with -1 (INVALID)

in_aiTrackDirections

int array

PATH_LENGTH

The direction of each track (FORWARD/REVERSE) in the path.

in_iTrainPosition

int


The position of the train on the track.

in_sUpdatePath

signal


Signals that the train con copy the path from the input into memory and start driving.

in_sAbort

signal


Signals to abort the driving process and wait for the new path to be available. Used for dynamical rerouting (NOT IMPLEMENTED)

in_bFacingBackwards

bool


Specifies whether the train initially faces forward or backward.

HAS_TRACK_CONTACTS

bool array

NUM_TRACKS

Specifies whether a track has contacts.

CONTACTS

bool array

NUM_TRACKS, 2

Hold information of triggered contacts.

Outputs

Name

Type

Length

Description

out_aiOccupiedTracks

int aray

MAX_OCCUPIED, 2


out_iTrainStatus

int



out_bFacingBackwards




Methods

Grap

Tags:
Created by stu115369 on 2019/08/29 13:13