You're reading ...
Traincontroller

Traincontroller 25: Flagman

We use physical sensors to let TC know an event has happened (mostly the event is that a train ran over the sensor, but there may be other uses like physical switches on a real control panel). But TC also has the option to use ‘software sensors’, so called ‘Flagman’, to let us know that a certain event has taken place.

A Flagman is a ‘virtual man’ who raises its ‘virtual flag’ when an event, or a logic combination of events, takes place. The flag is lowered again as soon as the events are not true anymore. In software terms, the Flagman is a memory location that can have two states: 1 or 0, TRUE or FALSE.

The events on which the Flagman should react are specified in the ‘Trigger’ tab of the Flagman properties (opened via a double click on the Flagman). It can be a single event, e.g. ‘Block 6 occupied’. It can also be a logic combination of several events, e.g. ‘Block 6 occupied’  AND ‘Block 7 occupied’ OR ‘Schedule 3 is running’.

What can we use Flagman for? Well … actually for anything we can imagine. Whether you need them depends on the things you like to accomplish.

A simple use could be just for graphics purposes, as is shown in the video with the toggle switch.

Also, it can be very useful to start or stop certain Operations as soon as a logic combination of events becomes TRUE.

Flagman can also be used inside Blocks. When a Flagman inside a block becomes TRUE, then that block gets the status ‘Occupied’. The video also shows an example on that.

About RudyB

Hobbyist

Discussion

No comments yet.

Leave a comment

Archive of all posts