This document explains how to modify the Virtual C.R.O. source code to display your own waveforms and add new experiments. For other information, see the main documentation.
To build the program, you need to compile the CRO.PAS file. The other .CRO files will be included and the VGA.OBJ file linked by means of {$I}
and {$L}
directives.
The code is written in Turbo Pascal 7. You will need a version that has the Uses Crt
bug (Runtime error 200) fixed.
Other than standard Pascal operators and library functions, you may also use the following functions defined in Maths.CRO:-
log10(x)
, exp10(x)
and exp2(x)
floor(x)
fdiv(a, b)
and fmod(a, b)
div
and mod
for floating-point numbersrad(x)
and deg(x)
Sine(t, A, f, P)
Square(t, A, f, P)
Triangle(t, A, f, P)
Pulse(t, A, f, Wid, Pos)
Modifying experiments is a straightforward process, as all the experiment definitions are in files neatly separated from the remaining code that provides the C.R.O. interface.
The Expt-Ini.CRO file describes the experiments, their parameters and the functions to be used for each input. The actual function definitions are in the Expt-Lib.CRO file.
The fastest way to specify the waveforms you want to display is to make use of experiment #0. As this experiment is already defined in Expt-Ini.CRO, you only need to modify the following functions in Expt-Lib.CRO:-
User1
..User5
: channel inputsUserZ
: Z inputUserT
: ext. trig. inputTo define entirely new experiments, modify the files as follows:-
Expt-Ini.CRO
LastExpt
by 1.
Expt
of type ExptData
:-,
] after the closing parenthesis [)
] of the last experiment (which should be the second last parenthesis in the file; the last one terminates the initialization of Expt
and is followed by a semicolon [;
]).
(
] to start your definition.
Name: 'Expt. name';
SigName: ('Ch. 1 name', 'Ch. 2 name', ...);
'-'
for unspecified signals.Signal: (f1, f2, ...);
None
for unspecified signals.Params:n;
Param:('param1', 'param2', ...)
)
].
Expt-Lib.CRO
Function f(t:time):voltage;far;
for the various signals, as per your definition in Expt-Ini.CRO. (time
and voltage
are double
s.)
v[1..10]
of type double
, in the order you defined in Expt-Ini.CRO. Utilize these in your function definitions.
Save your work, recompile CRO.PAS and you're done!
Virtual C.R.O. v 2.0 © 2000-2002 Madhav Shanbhag