ccusbcamac

Name

ccusbcamac -- Tcl Script CAMAC access CCUSBReadout slow-controls server

Synopsis

package require ccusbcamac

ccusbcamac::cdconn b c host port module

ccusbcamac::cdreg b c n

ccusbcamac::cfsa reg f a ?d?

ccusbcamac::cssa reg f a ?d?

ccusbcamac::qstop reg f a ?maxn?

ccusbcamac::qscan reg f a ?maxn?

ccusbcamac::cblock reg f a num

ccusbcamac::isOnline b c

ccusbcamac::getGl b

ccusbcamac::C b c

ccusbcamac::Z b c

ccusbcamac::isInhibited b c

ccusbcamac::Inhibit b c bool

ccusbcamac::ReadLams b c

DESCRIPTION

Summary of the command

PACKAGE COMMANDS

The commands below share many of the same parameters:

b

The branch index to use when computing the CC-USB's unique index.

c

A CAMAC crate number to be used when computing the CC-USB's unique index.

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.\

reg

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

package require ccusbcamac

Loads the commands in the ccusbcamac package into the interpreter provided that the NSCLDAQ Tcl package repository and lib directory are in the interpreter search path. See The ccusbcamac Tcl Package chapter for information about how to add the NSCLDAQ Tcl package repository to the interpreter search path.

ccusbcamac::cdconn b c host port module

Registers the name of the host running the CCUSBReadout program (i.e. host), the port it listens for connections on (i.e. port), and the name of the module loaded into the slow-controls server (i.e. module) into a connection information database. The b and c parameters are used to compute a unique index to associate the connection information to. For any given b and c combination, this MUST be called before any other procs sharing the same comabination of b and c.

ccusbcamac::cdreg b c n

Creates a handle to a module in the CAMAC system. The command returns a handle which is the reg parameter in subsequent commands that operate on a module. A connection is established with the slow-controls server using the information passed in the cdconn proc.

ccusbcamac::cfsa reg f a ?d?

Performs a CAMAC operation on the module reg. reg is a module handle created by a call to cdreg. If the function transfers data the least significant 24 bits of data are transferred. If the function is a write operation, the d parameter is required and is the data to write.

The return value is a 3 element Tcl list. The second element of the list is the Q response. The third element of the list is the X response. The meaning of the first element of the list depends on the f parameter. If f is the read operation, this will be the value read from the module. If f is a write operation, this will be the d parameter. If f is a control operation (non data transfer), this will be zero.

ccusbcamac::cssa reg f a ?d? - perform a 16 bit camac operation

Identical to ccusbcamac::cfsa however all data transfers only transfer the least significant 16 bits. Since the data path to the controller is only 16 bits, this is significantly faster than 24 bit transfers when the top bits are not required.

ccusbcamac::qstop reg f a ?maxn?

Performs the same read operation until the operation no longer returns a Q. If the optional maxn parameter is present this also sets an upper limit in the number of transferrs. The return value from this is a list of the data read from the module. Only read functions are suportedby this and all block functions. At the moment, these only support 16-bit dataway operations.

ccusbcamac::qscan reg f a ?maxn?

Performs a Qscan block transfer. After each read operation, the subaddress is incremented. Once a module no longer responds with a Q, the subaddress is reset to zero and the slot is incremented. This continues until no X response is returned. If the optional parameter maxn is provided, it limits the maximum transfer count to maxn. At the moment, these only support 16-bit dataway operations.

The return value is a list of data that was returned from the module. These are textual ascii values, not a binary block.

ccusbcamac::cblock reg f a num

Peforms num read operations on the module specified by reg. Data read are returned as the module's result in a Tcl list.

ccusbcamac::isOnline b c

Returns true if the specified VME create is online (attached to the controller and powered up).

ccusbcamac::getGl b

NOT IMPLEMENTED in the ccusbcamac package because there is not meaningful translation of it to a CC-USB.

ccusbcamac::C b c

Peforms a C cycle on the selected crate

ccusbcamac::Z b c

Performs a Z cycle on the selected crate.

ccusbcamac::isInhibited b c

Returns non zero if te specified crate is inhibited

ccusbcamac::Inhibit b c bool

Sets or clears the inhibits for the selected crate. If bool is on zero the crate is inhibited otherwise it's uninhibited.

ccusbcamac::ReadLams b c

Reads the crate LAM register.