DigiScope is a program to collect, log and interpret realtime the datastreams between a Digital modelrailroad and a controlling computer. Data is presented in 2 ways on the screen:
DigiScope can record the datastream with a timestamp per 'frame' in a file for later formatting. It can also record the raw datastreams (not the demo versions).
The data is collected from the Transmit and Receive wires of the connection between computer and Digital modelrailroad Interface. Since a COM-port has only 1 receive-data wire, 2 COM-ports are needed to collect both datastreams simultaneously. If you are interested only in one of both datastreams just don't connect the other port.
A schematic of the hardware setup is given in the figure below:
Fig 1: Overview of DigiScope
COM1 monitors the command's from computer to Interface, COM2 monitors the data from the Interface to the computer (not interchangeable). As you can see, DigiScope does not intercept and retransmit the datastreams, but just copy the data over the transmit and receive wires. Other COM-port signals are not set and ignored. Therefore DigiScope needs not be active while your computer controls the model railroad. It can be started and stopped at any convenient moment, but of course data collection happens only during its active state!
You need a proper 'T'-cable. The connections depend on the type of connectors on your COM-ports. Wiring for both 25-pin and 9-pin RS232 connectors is shown below:
Fig 2: Wiring for Märklin Digital
Fig 3: Wiring for Lenz Digital Plus
If the COM-ports of your PC have different connectors, you must make the proper selection from the left and right part of this picture! The CTS signal is not monitored by DigiScope, so you won't need a wire for that signal to the DigiScope computer, nor any other wire!
The function of each port is fixed. If you connect the COM-ports to the wrong lead, DigiScope will misinterpret the data.
To start DigiScope simply call it from an OS/2 command prompt.
The following parameters may be specified
For video-performance it is recommended to run DigiScope in an OS/2 full-screen session. The number of lines on the screen (VGA assumed may be changed at any moment with keys F2 through F6 in resp. 25, 34, 43 50 or 60. In a full-screen session the font will change automatically to fit all lines on the screen. In a windowed session, the font will not change automatically, but you may change it with the window properties. Otherwise you may have to use the scrollbar to view hidden parts of the window.
F1 shows some Help information.
'Home' starts a new data collection phase: the screen is cleared, all
counters and states are reset to zero and data collection starts as if the
program was just started.
DigiScope is terminated with the ESC-key or F12.
It may take a second or two before all buffers have been saved on disk!
The figure below gives an impression of the screen layout. The left half of the screen is a logging window, the right half a realtime pseudo graphical presentation of the state of the model railroad.
Fig 4: Screen capture of realtime animation (Märklin sample)
The presentation space contains the following areas:
The presented data in the logging window may be selected (filtered). Toggling between ON (display) and OFF (suppress) is done with keys:
| trigger | Action |
|---|---|
| L | log to file xxxSCOPE.TRC (display filters are ignored) |
| R | dump raw data to xxxSCOPE.RWn (n = '1' or '2', no timestamps, not supported by demo-version) |
| C | character mode (ASCII interpretation of the command or response) cannot be toggled with Intellibox protocol ('U') |
| H | hexadecimal mode (includes the timestamp) |
| I | Input (frames from Interface) |
| O | Output (frames to Interface) |
| G | (pseudo) Graphic presentation on right half of screen |
Note:
By toggling 'L' DigiScope starts or stops logging data to disk. The logfile contains binary data that can be formatted with DIGITRC, available separately. To format a trace enter:
DIGITRC DIGISCP.TRC >DIGISCP.FMT
DIGISCP.TRC is the input logfile. DIGISCP.FMT is the output file. If no output file is specified the output goes to the screen.
Note: Records of input and output data streams may not always be in the proper sequence in the tracefile, observe the timestamps!
The demo version of DigiScope writes only a limited number of frames to the trace file.
When recording raw data each of both datastreams goes to a separate file (DIGICOPE.RW1 for what is received by COM1, and DIGISCPE.RW2 for COM2). Recording is done at the moment a receive buffer is full. When you disable recording (change 'R' flag to 'r'), the current buffer contents are not recorded and lost, and when enabling recording the buffer may contain data from before this enabling time. There is no way to distinguish one piece of data from the other.
The recording files are opened in append-mode. Contents of previous recordings are preserved. You may want to erase old datasets before starting DigiScope to prevent confusion and undesired growth of files!
This facility is just a 'double check' in case you seem to receive many incomplete frames or garbled data. There is not formatting program for this type of file delivered with this package. You'll need a hexadecimal editor to examine the data and a manufacturer's manual for its interpretation.
DigiScope is a 32-bits multithreaded (internally multitasking) application for OS/2 Warp 4.0 or higher. This design ensures that all data is captured, even at high data transfer rates. The data collection threads (one for each COM-port) have minimal function, run at a high priority level and have a large buffer. The received frames are sent with a timestamp via a queue to the display and logging thread, which runs at a lower priority level than the monitoring threads.
With heavy traffic and when using a relatively slow machine for DigiScope you may notice a delay in the actual display of the data. However the timestamps are taken at the moment the data is received in the COM-port buffer and will be close to reality. When the delay becomes very large buffer, one of two conditions may arise:
When DigiScope is terminated the data collection threads will be stopped first. The program finishes only after all collected data has been displayed and written to disk if any of the recording facilities were active.
The DEMO version of DigiScope may be used and distributed for free as long as you don't change anything and keep it as a complete self-contained package. There are only slight restrictions in the DEMO versions compared to the full-function version:
The full function version of DigiScope is available to registered users of the DigiAPI package (see below).
Comments and suggestions are welcome!
Enjoy!
Rob Hamerling
E-mail: r.hamerling@planet.nl
| Version | Date | Highlights of changes | |
|---|---|---|---|
| 1.0 | 24 July 1998 |
|
|
| 2.0 | 28 July 1998 |
|
|
| 2.1 | (unpublished) | ||
| 2.2 | 26 December 1998 |
|
|
| 2.3 | ? |
|
|
| 2.4 | 12 November 1999 |
|
|
| 2.5 | 12 Januari 2000 |
|
|
| 3.1 | 2 September 2001 |
|
For much more information about computer controlled (model)railroading, you may have a look at the authors homepage on Internet: http://www.geocities.com/digithalys/
This homepage contains among others:
| Program | Description |
|---|---|
| AsynMon | Versatile RS-232 protocol analyser, with special feature to analyse
digital modelrailroad system.
Freeware for non-commercial users. |
| DigiAPI | Application Program Interface (API) and driver for Marklin Digital,
Lenz Digital Plus and Trix Selectrix systems. Provides a high-level
interface for developing programs in C or QuickBASIC, under OS/2 or
DOS. Relieves the programmer from dealing with COM-ports, contains
high-resolution timer, a command-trace facility for debugging, etc.
Extensive documentation.
C-Source of 'Calibrate' and a QuickBasic program included. Shareware. |
| HanDig | Simple but versatile manual control of any digital modelrailroad
supported by DigiAPI from computer keyboard and limited mouse
support as well. Demo of DIGIAPI.
Shareware |