|
|
AnwendungsprogrammeZu der Library gehört auch eine Reihe von Anwendungen, welche die Fähigkeiten des Codes demonstrieren oder dem Anwender bei der Fehlerdiagnose helfen. Die folgenden Abschnitte dokumentieren die zentralen Applikationen. Das Programm listenerDas wichtigste Diagnoseprogramm auf der untersten Ebene ist
Usage:
listener [options]
This program listens passively on a local serial port for incoming
packets and dumps them on screen or to a logfile.
Options:
-b, --busywait Use busy waiting (more accurate timing)
-d, --device name Serial port device, default /dev/ttyS0
-h, --help Show this summary
-l, --logfile name Logfile name, default is standard output
Copyright 2005 Stephan Höhrmann, published under the GPL.
Wie die Pakete ausgegeben werden, zeigt das folgende Beispiel. Jede Zeile
entspricht einem Paket, sie beginnt mit einem Zeitstempel, der in Sekunden
angegeben ist. Dahinter folgen ein beschreibender Text
( 0.000 nodelink: open logfile 0.001 nodelink: send [request<1> connect, reset=no] 0.011 nodelink: receive [reply <1> connect, channel=0] 0.011 nodelink: send [request<2> keepalive] 0.021 nodelink: receive [reply <2> keepalive] 0.022 nodelink: send [request<3> signals, 3:??? 2:??? 1:??? 0:??R] 0.032 nodelink: receive [reply <3> signals, 3:... 2:... 1:... 0:..R] 0.033 nodelink: send [request<4> disconnect, reset=yes] 0.043 nodelink: receive [reply <4> disconnect] 0.044 nodelink: close logfile In jedem Paket stehen nach der Art ( Das Programm simnodeEin anderes Diagnoseprogramm verwandelt einen Rechner in eine simulierte Leistungselektronik ohne angeschlossene Peripherie. Sie wird über ein serielles Nullmodemkabel an einen beliebigen Steuerrechner angeschlossen. Der Bildschirm des Simulators zeigt den internen Zustand an und kann so gut überwacht werden. Das Programm eignet sich insbesondere dafür, Steuerprogramme auf anderen Systemen wie den TTP-Knoten zu untersuchen.
Usage:
simnode [options]
This program transforms the computer into a simulated railway
controller node that is controlled by an external host using
a serial nullmodem cable.
Options:
-c, --channel N Simulator channel number [default 0]
-d, --device dev Serial port [/dev/ttyS0]
-h, --help Show this summary
-l, --logfile filename Log communication to a file
-n, --no-visual Do not show the status display
Copyright 2005 Stephan Höhrmann, published under the GPL.
Der Bildschirm zeigt alle Sensoren, Aktoren und den Inhalt des EEPROMs in lesbarer Form an.
--------< Simulated railway controller node >---------------------------
Channel: 0
Signals: (0) ... (1) ... (2) ... (3) ...
Points: (0) . (1) . (2) . (3) .
Contacts: (0) --- <0> (1) --- <0> (2) --- <0> (3) --- <0>
C0:0 . C0:1 . C1:0 . C1:1 . C2:0 . C2:1 . C3:0 . C3:1 .
Track 0: enabled, off, pwm ratio 0
no train, speed 0
Track 1: enabled, off, pwm ratio 0
no train, speed 0
EEPROM: ( 0) 0 ( 1) 0 ( 2) 0 ( 3) 0 ( 4) 0
( 5) 0 ( 6) 0 ( 7) 0 ( 8) 0 ( 9) 0
(10) 0 (11) 0 (12) 0
Das Programm nodediagsDie Funktion einer echten Leistungselektronik kann mit Hilfe von
Usage:
nodediags [options] test(s)
Diagnostic tool that can connect to a single controller node via all
available nodelink types and run tests on it as well as on the
connection itself.
Options:
-d, --device spec Specify all nodelink parameters
-h, --help Show this summary
-l, --logfile name Log the communication to a file
-v, --verbose Show more information if available
Nodelink specifications used by the device parameter:
tty:<device filename>
can:<local CAN device>:<remote node number>:<remote device>
udp:<remote hostname>:<remote device>
sim
Many fields can be left empty and will be filled with default values that
are identical to those shown in the following examples.
tty:/dev/ttyS0 (default device)
can:/dev/pcan32:0:/dev/ttyS0
udp:node00:/dev/ttyS0
sim
The following test programs are available:
link Basic nodelink communication
hardware Hardware functionality
eeprom EEPROM error counters (default)
Copyright 2005 Stephan Höhrmann, published under the GPL.
Kurz gesagt kann das Programm eine Statistik der Paketlaufzeiten aufstellen, die Hardware auf der Diagnoseplatine in einem beobachtbaren Tempo ansteuern sowie die Fehlerzähler im EEPROM des Mikrocontrollers auslesen und zurücksetzen. Das Programm diagnosticsDie umfangreichsten Tests sind mit
Usage:
diagnostics [options] test(s)
Diagnostics utility for the railway system. This program can access the
error counters of the controller boards and perform a variety of checks
to test the functionality of the system.
Options:
-c, --can device Use CAN for communication
-d, --detailed Run detailed tests instead of quick tests
-h, --help Show this summary
-s, --system name Select the system to test
-t, --tty device Use TTY for communication
-u, --udp Use UDP for communication
The following systems can be tested:
oval Small test system
kicking Kicking Horse Pass (default)
The following test functions can be executed on the system:
signals Test signal LEDs inside the blocks
contacts Test contacts, direction and location
usedtracks Test track usage sensors
points Test point operating units
lights Test lights on the whole system
gates Test crossing gates, sensors and signals
bells Test crossing bells
nodelinks Test nodelink communication
eeprom Display hardware error counters
cleareeprom Reset error counters to zero
reset Reset all controllers
driveic Drive from IC_ST_3 through inner circle
driveoc Drive from OC_ST_1 through outer circle
drivekh Drive from KH_ST_1 through pass
driveov Drive through the test oval
Copyright 2005 Stephan Höhrmann, published under the GPL.
Besonders interessant ist die Möglichkeit, alle Fehlerzähler der Anlage auszulesen. Das Programm ordnet allen Gleistreibern und Kontakten die Bezeichnungen aus dem Gleisplan zu und ist so einfach zu interpretieren. Funktionen zum Abfahren der verschiedenen Kreise der Anlage runden die Testmöglichkeiten ab. Das Programm apidemoWie Programme zur Steuerung des Fahrbetriebs aussehen, zeigt das einfache
Beispielprogramm |