Virtual C.R.O.


The Virtual C.R.O. program simulates a Cathode Ray Oscilloscope (C.R.O.). It has been designed for engineering students to study various waveforms using a C.R.O.-like interface, since the actual C.R.O. and the circuits they are studying may not always be available to them due to limited laboratory access.

Please note that this is merely a software simulation, and the waveforms that the program displays are software-generated (using programmed mathematical expressions). This is not a program which works with hardware circuits or reads data from the computer's ports.

This program could be used for the following:-


Inputs

The virtual C.R.O. has 5 input channels, plus inputs for external triggering and intensity modulation (Z input). What 'signals' are 'connected' to each channel is defined by the 'experiment' you select, and its parameters. The program includes a set of common experiments; you can add your own by modifying the source code and re-compiling the program.

At the start of the program, you are offered a list of experiments to choose from. Select an experiment by specifying its serial number (or enter -1 to exit). You can then enter values for the parameters of that experiment, as explained in the next section.

Expt. #0 and #1 aren't real experiments - they can be used to 'play' with the program.
Expt. #0 is meant to be used for user-programmed inputs. You can modify the source code to make this experiment display your own waveforms (as a quicker alternative to adding a new experiment altogether). By default, this experiment simply defines one sinusoidal and one triangular wave with badly mismatched frequencies, which demonstrates triggering issues.
Expt. #1 connects 'function generators' to the inputs. The nature of each wave (sinusoidal, square or triangular) and its amplitude, frequency & phase can be specified. This is useful for observing and studying most C.R.O. functions and effects.

The remaining experiments are common experiments such as frequency & phase measurement, oscillators, rectifiers, clippers and many types of modulation.


Parameters

After selecting an experiment, you can specify the parameters associated with it, such as the relevant voltages, frequencies, component values, etc.

You will be asked for the value of each parameter, with a prompt that usually displays the commonly used notation for that quantity - in the context of that experiment. Conventionally, all values are entered in SI units. You may append the character 'e' followed by an integer to denote an exponent. So 15 kHz can be entered as 15e3 and 0.1 µF as 0.1e-6.


Operation

After selecting an experiment and specifying its parameters, the C.R.O. screen will be displayed. Each of the 5 channels is plotted in a different colour (green, cyan, yellow, red or blue).
Initially, only Channel 1 is displayed. Press 1..5 at any time to toggle the display of the corresponding channel. (This is an extension of the mono/dual modes of a real C.R.O.)

A panel at the bottom displays the status of the C.R.O. 'controls', such as time and voltage scales and various modes.
Though more than one channel may be traced on the C.R.O. screen, the left part of the panel displays information for only one channel at a time. The title, colour and description indicate which channel this is. Adjusting channel-specific controls such as the voltage scale, vertical position, GND mode, etc. only applies to this 'current' channel. To view or edit the controls for a different channel, use the PgUp / PgDn keys, or press F1..F5.
On the other hand, the right part of the panel displays information for controls that apply to all channels, such as the time scale, triggering mode, X-Y/t-Y mode, etc.

You can press Ins / Del to display/hide the current channel. Disp or Hide is shown accordingly in the panel.

Use the arrow keys to adjust the time/voltage scales (in the usual steps of 1, 2 and 5). To move the trace, use the arrow keys with the Shift key held down. If Scroll Lock is on, the behaviour is the opposite. Hold down both the Shift keys to move the trace finely.

Spacebar toggles whether the channel is grounded (GND mode).
The Z key toggles Z mode (intensity modulation).
The * key toggles between t-Y and X-Y modes (X ≡ Channel 2).

In t-Y (non X-Y) mode, unlike a real C.R.O. which needs to keep tracing the waveform, the program needs to trace just once and stop. Hence, there are no triggering concerns. However, if you would like the program to emulate a real C.R.O., it can repeatedly trace the waveform and make use of triggering.
Press Alt+n to trigger from channel n or Alt+E to trigger from the 'Ext. Trig.' input defined for that experiment. Press [ or ] to decrease/increase the triggering level (hold down Shift for fine adjustment), press = to reset it to zero. The / and \ keys choose between triggering on the positive and negative slopes.
If triggering in this manner is not stable, one or more of the waveforms will blot out the screen as it is repeatedly retraced (on a real C.R.O. it would have appeared to be moving).
Press Alt+0 to return to the default 'Hold' mode.
As an example, you can run the experiment for Frequency Modulation (FM), and see why you should trigger using the modulating signal on Channel 2.

At times, a channel may appear to be incorrectly hidden or grounded. This is usually due to a very high or very low voltage scale setting for that channel, or because of poor triggering. It could also be that a later channel is entirely tracing over that channel.

The program does not plot the waveform for every infinitesimal value of time. Therefore, some plotted waveforms may appear discontinuous at some points. To obtain a continuous display, use the 'Join' mode, which joins every plotted sample to the next using lines.
Pressing Tab toggles Join mode on and off. Pressing Shift+Tab chooses between a light and a solid join. The default is a light join. This will display, for example, the vertical edges of a square wave in a fainter trace, like a real C.R.O.

You can increase/decrease the screen size using the + / - keys. The screen is anchored at the top right so that the first quadrant is always visible. If the panel gets obscured by an increased screen size, you can hold down Ctrl to temporarily display it on top of the screen.

The S, G and T keys change the colour of the screen, grid and trace respectively. You can cycle through 64 possible colours. Hold down Shift to cycle in the reverse order.

You can save the above 'aesthetic' preferences, viz. the colours, screen size and join modes, by pressing End. They will be written to a file named CRO.cfg. You can then press Home at a later point to re-load these preferences.

Pressing Backspace resets all controls to their initial values.

To conveniently measure voltages and time differences, you can enter 'Measure mode'. Once in this mode you can use the mouse to take measurements. None of the keys will work until you press Esc to leave this mode.
Right-clicking at any point displays the time and voltage values at that point (w.r.t. the origin). Drag the mouse from one point to another to measure the time and voltage differences between those two points. This could be used to measure time periods, peak-to-peak voltages, etc.

To re-run the same experiment with different values for the parameters, press Enter.
To choose another experiment, press Shift+Enter to return to the experiment selection screen.
(All controls will retain their values in either case.)

To exit the program altogether, press Esc.


Virtual C.R.O. v 2.0 © 2000-2002 Madhav Shanbhag

I hope you found this program useful. Any suggestions or comments are welcome.

The program and source code are not guaranteed to be free from bugs, but none have been discovered so far. It is possible that the mathematical definitions of some functions are wrong, but I doubt this. Please report anything which you think is a bug or a mistake.

You are free to distribute the original executables and source code of this program, provided you do not charge anything for them. You may modify the source code and re-compile it for personal/local use, but may not publicly distribute such modified versions of the program without including copies of all originals. An unmodified copy of this documentation must accompany all distributions.