rphot-photometer readout server
rphot [debug] [int] [port=]
rphot is a server program that controls the Computerboards
CIO-CTR5 counter card.
rphot uses the BAIT
to communicate over BSD socket.
The default port number is 0x1340.
rphot is often not started by itself but is instead
fired up the by startnet script.
int -allows commands to by typed in the keyboard rather than
thru the BSD socket.
The data cannot be inspected in this mode.
debug -more debugging printout about what is going on.
sets the port to the specified value int Hex (e.g. 0x1341).
The default value is 0x1340.
rphot accepts the following command:
counter [nsamples=0] [rate=] [fname=] [mark]
and replies with the string similar to:
done counter nsamples=100 integer nbytes=200 rate=100
nsamples- specifies the number of measurements. i.e.
nsamples=100 will return 100 numbers
or 200 bytes.
The default number of samples is 0.
All numbers will be returned as 16 bit short integers in
highendian order as required by the protocol.
rate- sets the sampling frequency
There is no default value of the rate and it will
remain the same as the last time set.
(This behavior violates the protocol and may
be changed in the future.)
fname= is not used by rphot but is
passed back to the client program so that the data
can be written to the file with the specified name.
mark- causes the 14th bit (16384) to be set to one
for the counter 2 only. Use this for synchronizing to the flip flop
shown in drawing 31E009.
The counter rate is derived from an internal crystal
clock of not particularly high accuracy.
The clock divides a 10kHz rate to get the sampling
rate; i.e. it calculales an integer n=10,000/f_desired.
Note: the actual sampling rate will be reported on the
- for 1000 Hz sampling, n=10 the actual rate will be 1000 Hz.
- for 2000 Hz sampling n=5 and the actual rate will be 2000 Hz.
- for 3000 Hz sampling n=3 and the actual rate will be 3333.33.. Hz
done return; no error message will result from a
The CIO-CTR5 uses the wretchedly complex
AMD 9513 counter
The first CIO-CTR5 is setup as follows:
Interrupts are enabled by writing a 1 to Dig 0 output.
- Counter 1 counts when gate is high
- Counter 2 counts when gate is low
- Counter 5 is rate generator
LOW LEVEL SOFTWARE
The rphot program communicates with the
CIO-CTR5 via a homemade Linux device driver
The installable module is loaded by
a command in the file /etc/rc.d/rc.local.
Last Revised September 6, 2000