The vmusb command can be used in the daqconfig configuration file to control the internal reasources of the VM-USB as well as to enable the readout of its pair of scalers. The VM-USB provides two outputs named O1 and O2 as well as a pair of gate and delay generators (DGGA and DGGB), and scalers A and B. Four LEDs round out the resources controlled by this command.
In order to use a vmusb module to configure the controller, you must include it in a stack, even if you are not using reading the scalers in the VM-USB. This is because it is the inclusion of a module in a stack that causes its initialization methods to be invoked, and it is there that teh vmusb module configures its resources.
More information about the VM-USB and its resources can be found in sections 3.4.4 through 3.4.8 and section 1 of the VM-USB manual.
The configuration options are described in the OPTIONS section below.
-nimo1
Determines, along with the options
-inverto1
and
-latcho1
the behavior of NIM
output O1. This can be any of the following values:
busy, trigger, busrequest, eventdatatobuvffer,
dgga, endevent or usbtrigger.
If not explicitly programmed, this defaults to busy.
-inverto1
Inverts the sense of the O1 nim output. By default this is false.
-latcho1
Latches the O1 asserted when the condition that asserts it is met. By default this is false.
-nimo2
Along with the options
-inverto2
and
-latcho2
, controls when the NIM
O2 output is asserted. This can be any of:
usbtrigger, vmecommand, vmeas,
eventdataobuffer, dgga, dggb, or
endevent.
By default this is vmeas which reflects the VME address strobe line.
-inverto2
Inverts the sense of the NIM O2 output. This is false by default.
-latcho2
Latches the state of the O2 NIM output when the condition that would assert it is met. This is false if not explicitly programmed.
-topyellow
Together with -inverttopyellow
and -latchtopyellow
determines
when the top Yellow LED of the VM-USB is lit.
This can be any of the following values:
ofifonotempty, infifonotempy, scaler
infifofull, berr, vmebr, or
vmebg.
If not explicitly programmed, this will default to ofifonotempty, that is lit when there is data in the output fifo.
-inverttopyellow
Inverts the sense of the top yellow LED. Defaults to false.
-latchtopyellow
Latches the top yellow LED in the on state when the condition is met that would light it. Defaults to false.
-red
Together with the -invertred
and
-latchred
options controls the
when the red LED on the VM-USB front panel is lit.
This can be one of the following value:
trigger, nimi1, nimi2, busy, dtack, berr, vmebr
or vmebg.
If not explicitly programmed, this defaults to busy, and is therefore lit when the VMUSB is busy.
-invertred
Inverts the state of the red LED. Defaults to false
-latchred
Latches the red led on when the condition to light it has been met. Default value is false.
-green
Together with the -invertgreen
and -latchgreen
, determines when
the green LED is lit. This can be one of the following
values:
acquire, stacknotempty, eventready,
trigger, dtack, berr, vmebr or
vmebg.
If not explicitly configured, this defaults to acquire.
-invertgreen
Inverts the condition that lights the green LED. Defaults to false
-latchgreen
If true, the green LED is latched in the on state once the condition that would light it is met. If not configured defaults to false.
-bottomyellow
Together with -invertbottomyellow
and -latchbottomyellow
determines
when the bottom yellow LED is lit. The value of this
option can be any of the following values:
notslot1, usbtrigger, usbreset, berr, dtack, vmebr
or vmebg.
If not explicitly configured, defaults to dtack. This is the VME bus Data Transfer Acknowledge signal that target modules use to indicate that a transfer operation is complete.
-invertbottomyellow
Inverts the condition that lights the bottom yellow LED. Defaults to false if ot explicitly configured.
-latchbottomyellow
Latches the bottom yellow LED in the lit state once the condition is met to light it. Defaults to false.
-readscalers
If this is true the two scalers A and B will
be read by the stack in which the vmusb is
module is put. The A scaler is read first followed
by the B scaler. See -scalera
and -scalerb
below which define
when each scaler increments.
By default, the value of this option is false, meaning the scalers will not be read.
-incremental
This option is ignored unless -readscalers
is true. If -incremental
is true,
scalers are cleared after they are read.
Note that since the VM-USB has no mechanism to
atomically read and clear scalers, counts can be lost
between the read and clear.
By default this is true. If you plan to use the VMUSB scaler(s) as a timestamp, you must set this to false.
-scalera
Determines the condition that increments scaler A. This can be one of the following values: dgga, nimi1, nimi2 or event.
By default, this value is nimi2, causing this scaler to be incremented on an external pulse plugged into the IN2 input.
-scalerb
Determines the condition that increments scaler B.
This can be one of the following values:
carry,, nimi1, nimi2 or
event.
The carry value means that
scaler B is incremented when scaler A overflows.
This allows both scalers to be combined into a single
64 bit scaler that is incremented by the condition
defined in the -scalera
option.
By default this option is carry making Scaler B the high order bits of a 64 bit scaler with Scaler A the low order bits.
-dgga
Determines the condition that causes the signal to be generated by the DGGA device. Options are: off, nimi1, nimi2,trigger, endofevent,usbtrigger, and pulser. The default option is pulser.
By default, the value of this option is pulser, starting DGGA on the internal pulser.
-dggb
Determines the condition that causes the signal to be generated by the DGGB device. Options are: off, nimi1, nimi2,trigger, endofevent,usbtrigger, and pulser. The default option is nimi2.
By default, this option is nimi2 starting DGGB when an input pulse is received on the IN2 input.
-widtha
Determines the width of the gate produced by dgga in units of 12.5 ns. This defaults to 1 giving a 12.5ns gate width.
-delaya
Determines the amount of time in units of 12.5 ns to delay the gate output of dgga once it has been triggered. Defaults to 0, no delay between the start and the gate output.
-widthb
Determines the width of the gate produced by dggb in units of 12.5 ns. This defaults to 1 resulting in a 12.5ns output pulse.
-delayb
Determines the amount of time in units of 12.5 ns to delay the gate output of dggb once it has been triggered. By default this is 0; no delay between start and gate output.
-mixedbuffers
Sets whether scaler and event data can coexist in the same buffer. The default is false.
false by default.
-spanbuffers
Sets whether event data can span buffer boundaries. Default is false.
-forcescalerdump
If set to true, the VM-USB will immediately output scaler data once a scaler stack is executed. Default is false. By default this is false
-busreqlevel
Determines the bus request level that the VMUSB will use for itself when it requests ownership of the bus. The valid values are any in the range [0,7] and the default value is 4.
-optionalheader
Determines whether a second optional header word will follow the first buffer header word. When present, this extra header specifies the number of words in the buffer. The default value is false. This is false by default.
-bufferlength
Determines size of the internal buffer used by the VMUSB in units of words. The VMUSB fills the buffer before outputting data on a usb_bulk_read so a smaller buffer size is useful for low data rates. The optional values are: 13k, 8k, 4k, 2k, 1k, 512, 256, 128, 64, and evtcount. The evtcount option depends on the value of the -eventsperbuffer option. The default value is 13k.
-eventsperbuffer
If the -bufferlength option is set to evtcount, this determines how many events must occur before transferring data to the FIFO for readout. The values can be any in the range [1,4095]. The default value is 1.