CAU

- The Model Railway
- - Software
- - - libRailControl
- - - - Constants/Functions
- - - - - Constants
- - - - - Initialisation
- - - - - Block Sections
- - - - - Points
- - - - - Signals
- - - - - Relay
- - - - - Velocity Meters
- - - - - Station Lighting
- - - - - Handling

Signal Control Functions

enginecarcar
int set_signal(int SIGNAL, int POSITION)

The function set_signal() sets the signal SIGNAL to the value POSITION. Signals may be specified by their labels which the library defines as symbolic constants. Legal position values are the symbolic constants RED signalling to stop, GREEN signalling to proceed, and GREEN_YELLOW signalling to proceed slowly. Alternatively, the symbolic constants HP0, HP1, or HP2 may be used. These are the official labels of German Rail for the respective signal positions. Please note that not all signals have a yellow light. An attempt to set a 2-light signal to GREEN_YELLOW will fail.
On successful completion the value SUCCESS is returned, otherwise the value FAILURE.

int get_signal(int SIGNAL);

The function get_signal() returns the signal position currently set by the last call to the function set_signal() for the specified signal SIGNAL.
On successful completion either RED, GREEN, or GREEN_YELLOW is returned, otherwise the value FAILURE. Again, alternatively HP0, HP1, and HP2 may be used.


Clemens Grelck
generated on: Mon May 31 10:20:25 MET DST 1999