camac

Name

camac -- Provide access to CES CBD8210 CAMAC to Tcl scripts

Synopsis

package require camac

camac::cdreg b c n ?vmecrate?

camac::cfsa reg f a ?d?

camac::cssa reg f a ?d?

camac::qstop reg f a ?maxn?

camac::qscan reg f a ?maxn?

camac::cblock reg f a num

camac::isOnline b c ?vmecrate?

camac::getGl b ?vmecrate?

camac::C b c ?vmecrate?

camac::Z b c ?vmecrate?

camac::isInhibited b c ?vmecrate?

camac::Inhibit b c bool ?vmecrate?

camac::ReadLams b c ?vmecrate?

DESCRIPTION

This package provides access to CAMAC modules via the CES CBD 8210 branch highway driver to Tcl scripts. Prior to use you must add the NSCLDAQ package repository path to the Tcl package search list.

PACKAGE COMMANDS

The commands below share many of the same parameters:

b

Is a branch number. For the CES CBD 8210 this is the number set in the front panel branch number switch.

c

A CAMAC crate number on some branch. This is set in the front panel rotary switch of the A1 or A2 crate controller installed in the right-most pair of slots of the crate.

n

The slot number of a module in a CAMAC crate. Slots in a CAMAC crate are numbered from 1 starting at the left.

a

The subaddress within a module. A CAMAC modules is defined to have 16 subaddresses numbered 0-15. Each module uses this set of subaddresses differently.\

vmecrate

A VME crate number in which at least one CES CBD 8210 module has been installed.

reg

A CAMAC module handle. These are produced using the camac::cdreg command below. This is used to select the CAMAC module operated on by several of the commands.

package require camac

Loads the camac package into the interpreter. The commands loaded are all in the camac namespace. The Tcl namespace import command can be used to allow access to these commands without using a fully qualified namespace, however if you are using other CAMAC Tcl libraries, beware as they will most likely implement the same commands in a different namespace.

camac::cdreg b c n ?vmecrate?

Creates and returns a handle to a CAMAC module specified by b c n and vmecrate. If the vmecrate parameter is omitted, VME crate 0 is used by default. The command returns a value that should be used as the reg parameter in subsequent operations in this package.

camac::cfsa reg f a ?d?

Performs a CAMAC operation on the module defined by reg. If the operation is a write, the d parameter must be supplied and is the data to write. The CAMAC bus is a 24 bit bus, so only the least significant 24 bits of d will actually be written.

The command returns a 3 element Tcl list. The first element of this list is the data parameter to the command if the f code was a write code. If f indicated a read, the first element of the list is the data read. If the f was a control operation, the first element of the list is meaningless. The second element of the list is the Q-response for the operation and the third element the X-response.

camac::cssa reg f a ?d?

Same as camac::cfsa however for data transfer operations, this only transfers the least significant 16 bits. Note that for the CES CBD 8210 16 bit operations are significantly faster than 24 bit operations as the data paths to the module are only 16 bits wide.

camac::qstop reg f a ?maxn?

Performs a Q-stop block transfer from the module specified by reg with the read function f. Only read Q-stops are supported. The function is repeated until no Q response is present or until maxn transfers have been performed, whichever is first. The result of this command is a Tcl list. Each element of the list a value read from the module during the read operation.

camac::qscan reg f a ?maxn?

Peforms a Q-scan block transfer. In a Q-scan operation the subaddress is incremented until the module does not return a Q at which point the subaddress is reset to zero and the slot is incremented. This process repeats until the read does not return a valid X-response or when maxn is exceeeded.

The command returns a list of the data that has been returned from the module.

camac::cblock reg f a num

Repeats the read operation num times putting the results of the reads into a list that is returned by the command.

camac::isOnline b c ?vmecrate?

Returns true if the CAMAC crate selected by the command parameters is online. This is not reliable as a probe for crates on branches that don't exist.

camac::getGl b ?vmecrate?

Returns the value of the graded lam register for the specified branch highway module.

camac::C b c ?vmecrate?

Peforms a C cycle on the selected CAMAC crate. This means that the crate dataway C line is pulsed by the controller.

camac::Z b c ?vmecrate?

Performs a Z cycle on the selected CAMC crate.

camac::isInhibited b c ?vmecrate?

Returns true if the specified CAMAC crate is inhibited (its I line is asserted).

camac::Inhibit b c bool ?vmecrate?

Sets the inhibit line of the specified crate to bool

camac::ReadLams b c ?vmecrate?

Returns the LAM register of the controller for the specified crate.