pixieplugin

Name

pixieplugin -- Suport dynamic configuration of Pixie16 modules via DDASReadout Server.

Synopsis


$DAQBIN/DDASReadout --init-script=pixieserver.tcl
            
#---- pixieserver.tcl:

lappend auto_path [file join $::env(DAQROOT) TclLibs]
package require pixieplugin

        

DESCRIPTION

pixieplugin is a package that can be sourced into a DDASReadout (or DDASReadout-extcl) readout program that starts a server that can allow remote applications to tweak Pixie16 configuration parameters. The server requires NSCLDAQ-11.3-020 or later and NSCLDDAS-3.4-000 or later.

When the server starts, it registers allocates a TCP/IP listen port from the NSCLDAQ Port manager, registering as the application pixe16config. The port manager on the system running the Readout program can, in turn be used to lookup the port to which a connection should be made.

For information about communicating with the server once a connection has been made, see COMMUNICATION PROTOCOL below.

Note that certain files must be present in the current working directory at the time the initialization script is executed. See FILES below. This requirement is not a real restriction because those files must also be present for DDASReadout to operate properly.

COMMUNICATION PROTOCOL

Communications with the server is completely textual. Each request consist of words of text. A word of text is text separated from subsequent words by whitespace. Each request consists of a request keyword, that identifies the request being made, followed by parameters as required by each request. Requests are terminaed by the Unix newline character \n.

Note that some requests can only be carried out when the pixie16 being targeted by the request is idle or all pixie16's are idle. These restrictions will be pointed out in the REQUEST DESCRIPTIONS. All pixie16 modules are idle when the run is halted.

The server will respond to the request with consisting of one or more words. The first word is a status code. The codes currently understood are:

0

Operation was successful. In this case additional words on the reply line may be data returned by the request.

-1

When carrying out the request an error was reported from an XIA API call. THe remainder of the line is a human readable message that describes the error.

-1000

A request was performed that required pixie16(s) to be idle. The remainder of the response line is an error message that humans can understand.

-1001

Parsing the request line failed. The remainder of the line is a human readable descriptive error message.

One important point to note. In the XIA API and the server, module selection is by module number, not slot number. The Inventory request can be used to obtain the module number to slot number correspondence. If you don't want to use this, however, the module number can be derived from cfgPixie.txt by subtracting 3 from the line number in tha file (numbered from 1) in which a slot is specified.

The following subsection describes each request and the data, if any that can be returned by a successful status (status 0) field in the reply line.

REQUEST DESCRIPTIONS

Inventory

Returns an inventory of the modules configured into the DDASReadout(-extclk) program. On success, the status will be 0 and there will be an additional number on the returned line. This number is the number of modules configured into the Readout. For each configured module a line will follow. The lines will be in module number order (thus the first additional line contains a description of module 0).

Each line that follows has the following integer fields in order:

  • PXI crate slot in which the module lives.

  • Module firmware revision number.

  • Module serial number.

  • Number of bits of resolution in the flash ADC.

  • Flash ADC sampling rate in Mega-Hertz.

For example a module with serial number 123 in crate slot 5 that is a 500MHz 14 bit module revision f will have a description line like:


5 15 123 14 500
                            

Boot module-index

Reloads/Resets the firmware for the module module-index (an integer module number). Initial DSP parameters are gotten from the settings file specified by the cfgPixie Be very careful using this operation because:

  • Since the assumption is that you are doing this to clear a hung module, you are allowed to boot an active module. Be sure you are not doing this on an active run.

  • If you are using INFINITY_CLOCK, note that a time synchrzonization will note be performed unless it is forced via DDASReadout's ddas_sync command.

As the modules boot, the XIA API outputs text to its stdout to display progress.

Readchanpar module-index channel parameter-name

Reads a channel level parameter from module number module-index's channel channel number. parameter-name is a text string that determines which parameter is read. See the table on page 60-61 of the Pixie16 programmer's manual for a list of the parameter names and their meanings.

On success the double precision parameter value is returned on the same line as the status. The transaction below shows the request and reply for module 0, channel 0 TRIGGER_RISETIME


Request:

Readchanpar 0 0 TRIGGER_RISETIME

Reply (if the rise time is 400ns):
0 0.4
                        

Readmodpar module-index parameter-name

Reads a module level paramter from the module specified by module-index (an integer). The actual parameter value read is specified by the text string parameter-name which can be chosen from the table on page 62 of the Pixie16 programmer's manual.

On success, integer parameter value is returned on the same line as the status. The transaction below shows the request and reply for module 0, FAST_FILTER_RANGE


Request:

Readchanpar 0 FAST_FILTER_RANGE

Reply (if the rang is 3):

0 3
                        

Writechanpar module-index channel parameter-name value

This operation is only legal for modules that are not actively taking data. If the plugin is being used used in e.g. DDASReadout the run must be halted to use this request.

Writes the value of a channel level parameter. As for Readchanpar module-index and channel select the module and channel operated on while value is the new double-precision value. No additional information is returned on the status line.

Here's an example of a successful request to set the trigger rise time of module 0's channel 0 to 500ns.


Request:

Writechanpar  0 0 TRIGGER_RISETIME 0.5

Successful Response:

0
                        

Writemodpar module-index parameter-name value

This operation is only legal for modules that are not actively taking data. If the plugin is being used e.g. DDASReadout the run must be halted to use this request.

The request writes a module level parameter. As with Readmodpar module-index selects the module and parameter-name the parameter to modify. value is a new proposed value for the parameter. All module level parameters are integers.

Here's a successful request/response that sets the FAST_FILTER_RANGE to 4.


Request:

Writemodpar 0 FAST_FILTER_RANGE 4

Successful Reply:

0
                        

Saveparams set-filename

This operation is only legal if all modules are not actively taking data.

The XIA API has the ability to create a snapshot of all DSP Parameters of all modules in the system into a file. This file can then be used to rapidly reload the DSP parameters at a later time. These files are called .set files. This request uses that API capability to save the current DSP parameters into the file set-filename.

Several important points:

  • The contents of .set files are specific to the digitzer models in the crate. Thus if you have saved a set file and later change the module in slot 2 from a 250MHz digitizer to a 500MHz digitizer he configuration of that digitizer will not be correct in the .set file and must be regenerated.

    This is because .set files are essentially dumps of the DSP parameter memory of each digitizer which contains the DSP parameters in device units, which vary from digitizer model to digitizer model.

  • More subtly, the set-filename parameter is interpreted in the context of the server not the client. It is also written by the server and therefore the effective user under which the server is running must have write access to the directory and, file into which the set file is being written.

Sample successful creation of a set file:


Request:

Saveparams /projects/separator/setfiles/meaningful-name.set

Successful reply:

0
                        

>Loadparams set-filename

This request can only be successfully performed if all configured digizers are idle (not taking data).

This request loads the contents of a .set file into the DSP parameter memories of all configured modules. Note that all of the important points described in Saveparams apply with respect to settings non-portability and filename interpretation, with the exception that the server only requires read access to the set file.

Sample successfl load oa set file:


Request:

Loadparams /projects/separator/setfiles/meaningful-name.set

Successful reply:

0
                        

AdjustOffsets module-number

This request performs an ADJUST_OFFSET run on the specified digitizer module (by number not slot).


Request:

AdjustOffsets 0

Successful reply:

0
                           

FILES

The following files must be present in the current working directory of the Tcl intepreter at the time the plugin package is loaded:

pxisys.ini

A file that describes the slot mapping in terms of the PCI resources on the PXI backplane. The contents of this file depend on the vendor that produced the backplane. We currently have versions of this file for several crate types stored in $DDAS_ROOT/share/crateconfigs.

cfgPixie16.txt

Describes the module configuration of the crate. This file also provides a default set file which must exist if you attempt to boot the modules.