NAME

rphot-photometer readout server

SYNOPSIS

rphot [debug] [int] [port=]

DESCRIPTION

rphot is a server program that controls the Computerboards CIO-CTR5 counter card. rphot uses the BAIT protocol 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.

OPTIONS

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.

port= sets the port to the specified value int Hex (e.g. 0x1341). The default value is 0x1340.

COMMANDS

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

Where:

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 in Hertz. 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.

RATE GENERATION

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 done return; no error message will result from a discrepancy.

COUNTER SETUP

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.

LOW LEVEL SOFTWARE

The rphot program communicates with the CIO-CTR5 via a homemade Linux device driver /dev/ctr5. The installable module is loaded by a command in the file /etc/rc.d/rc.local.


Last Revised September 6, 2000