30
Handel Programmer’s Guide - FalconXn Contents Introduction 3 Intended Audience ............................. 3 Conventions ................................. 3 Sample Code ................................ 3 hqsg-falconxn ............................. 3 Understanding Handel ........................... 3 Header Files .............................. 3 Error Handling ............................ 4 Thread Safety ............................. 4 INI Files ................................ 4 detChans ............................... 4 MCA Data Acquisition 5 Setting up Logging ............................. 5 Initializing Handel ............................. 6 Configuring Data Acquisition ....................... 6 GATE Veto ................................. 7 Run Control ................................. 8 Preset Runs ................................. 9 SCA Settings ................................ 10 Cleanup ................................... 11 Mapping Mode 11 Pixel Advance Modes ........................... 12 GATE ................................. 12 Host Control ............................. 12 Using Mapping Mode: A Walkthrough .................. 12 Enable mapping mode ........................ 13 Set the number of bins in the spectrum .............. 13 Set the total number of pixels to be acquired in this run ..... 13 Set the number of pixels per buffer ................. 13 Configure pixel control ........................ 14 Get the buffer length ......................... 14 Start the run ............................. 15 1

Handel Programmer's Guide - FalconXn

  • Upload
    others

  • View
    16

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Handel Programmer's Guide - FalconXn

Handel Programmer’s Guide - FalconXn

ContentsIntroduction 3

Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

hqsg-falconxn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Understanding Handel . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Thread Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4INI Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4detChans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

MCA Data Acquisition 5Setting up Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Initializing Handel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Configuring Data Acquisition . . . . . . . . . . . . . . . . . . . . . . . 6GATE Veto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Run Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Preset Runs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9SCA Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Mapping Mode 11Pixel Advance Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

GATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Host Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Using Mapping Mode: A Walkthrough . . . . . . . . . . . . . . . . . . 12Enable mapping mode . . . . . . . . . . . . . . . . . . . . . . . . 13Set the number of bins in the spectrum . . . . . . . . . . . . . . 13Set the total number of pixels to be acquired in this run . . . . . 13Set the number of pixels per buffer . . . . . . . . . . . . . . . . . 13Configure pixel control . . . . . . . . . . . . . . . . . . . . . . . . 14Get the buffer length . . . . . . . . . . . . . . . . . . . . . . . . . 14Start the run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

1

Page 2: Handel Programmer's Guide - FalconXn

Monitor the buffer status . . . . . . . . . . . . . . . . . . . . . . 15Read full buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Signal that the read has completed . . . . . . . . . . . . . . . . . 15Wait for buffer ‘b’ to fill . . . . . . . . . . . . . . . . . . . . . . . 15Repeat until all the pixels are collected . . . . . . . . . . . . . . . 16Stop the run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Mapping Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Acquisition Values 17Analog Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Pulse Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19MCA Data Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . 19SCA Data Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Mapping Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Run Data 22Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22MCA Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22SCA Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Mapping Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Special Runs 24

Special Run Data 25

Board Operations 25Settings and Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . 25Mapping Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

INI Format 26[detector definitions] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26[firmware definitions] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27[default definitions] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27[module definitions] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Legal 28

Licenses 28Handel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Disclaimer 30

Patents 30

2

Page 3: Handel Programmer's Guide - FalconXn

Introduction

Intended Audience

This document is intended for those users who would like to interface to theXIA FalconXn hardware using the Handel driver library. Users of the Handeldriver library should be reasonably familiar with the C programming languageand this document assumes the same.

This document assumes you have a FalconX1, FalconX4, or FalconX8 set up andconfigured on your local network. For information on setting up your hardwareand configuring it with ProSpect, please reference FalconX1/X4/X8 Quick StartGuide.

Conventions

Each Handel API that is discussed is linked to the Handel API Manual. Followthe link to view the function prototype and documentation of the API’s use.

CHECK_ERROR is a placeholder for user-defined error handling.

Sample Code

This guide includes inline code examples to illustrate how specific features areused. In addition to the inline code examples, sample applications are includedwith the Handel source distribution. Precompiled versions of the applications(for Windows) are also included.

Each application requires a file called falconxn.ini be present in the same directoryas the application. A sample file is included in the distribution.

hqsg-falconxn

This application walks through all of the steps required to acquire a single MCAhistogram with 5 seconds worth of data. This is the simplest example and showshow to use basic Handel from start to finish.

Understanding Handel

Header Files

Before introducing the details of programming with the Handel API, it is im-portant to discuss the relevant header files and other external details related

3

Page 4: Handel Programmer's Guide - FalconXn

to Handel. All code intending to call a routine in Handel needs to includethe file inc/handel.h as a header. To gain access to the constants used todefine the various logging levels, the file inc/md_generic.h must be included;additional constants (preset run types, mapping mode controls, etc.) are lo-cated in inc/handel_constants.h. The last header that should be included isinc/handel_errors.h, which contains all of the error codes returned by Handel.

Error Handling

A good programming practice with Handel is to compare the returned statusvalue with XIA_SUCCESS – defined in handel_errors.h – and then process anyreturned errors before proceeding. All Handel routines (except for some ofthe debugging routines) return an integer value indicating success or failure.While not discussed in great detail in this document, Handel does provide acomprehensive logging and error reporting mechanism that allows an error to betraced back to a specific line of code in Handel.

Thread Safety

Handel uses background threads to serialize IO processing, but the APIs are notthread-safe. It is the responsibility of any application making Handel calls toensure that only one thread is allowed to access Handel at a time.

INI Files

The last required file external to the Handel source code is an initialization,or “.ini” file. The .ini file defines the setup of your system by breaking theconfiguration down into the following categories: detector, firmware, hardware,and acquisition values.

XIA’s general recommendation is to use ProSpect to optimize your system andsave an .ini file for use in your application. However, by referring to an existingHandel .ini file and the specifications in the reference section INI Format, youcan also edit .ini files by hand or generate them in your application.

XIA provides sample .ini files in the ProSpect SDK folder. We plan to supportautomatically generating .ini files with a Configuration Wizard in a future version.

detChans

Most routines in Handel accept a detChan integer as the first argument. Asdiscussed in [module definitions], channel{n}_alias, each channel in the systemmust be assigned a unique ID. Handel .ini files generated by ProSpect followthe convention of assigning 0 to the first channel in the first module and N - 1,

4

Page 5: Handel Programmer's Guide - FalconXn

where N is the total number of channels in the system, to the last channel in thelast module. If you know the number of channels in the system, you can treatthe detChan parameter as a 0-based index. For more information on robustlyquerying the system, see Enumerating Modules and Channels in the Handel APIManual.

Some routines in Handel – mostly routines that set a value – allow the specialdetChan -1 to be passed as an argument. This special value represents all of thedetChans in the system. When calling routines like xiaSetAcquisitionValues()the -1 detChan is a convenient shortcut that eliminates the need to loop over allchannels.

Other tasks, such as run control and reading module statistics, only need to becalled on one channel per module. In these cases enumerating the modules is anappropriate technique.

The following table lists various acquisition tasks and indicates how each maybe addressed.

Task Per channel Per module System (detChan -1)xiaSetAcquisitionValues, all values X X XxiaDoSpecialRun adc_trace XxiaStartRun/xiaStopRun X XxiaGetRunData mca XxiaGetRunData module_statistics_2 1 X XxiaBoardOperation, all mapping-related operations XxiaGetRunData, all mapping-related data X

MCA Data Acquisition

Setting up Logging

Handel provides a comprehensive logging and error reporting mechanism thatallows an error to be traced back to a specific line of code in Handel. To utilizethe logging system, a log file needs to be designated, preferably at the beginningof the application:

CHECK_ERROR(xiaSetLogLevel(MD_DEBUG));CHECK_ERROR(xiaSetLogOutput("handel.log"));

See xiaSetLogLevel() and xiaSetLogOutput().1module_statistics_2 may successfully be retrieved for each channel, but each call returns

the statistics for the whole module.

5

Page 6: Handel Programmer's Guide - FalconXn

Initializing Handel

Before acquiring data with Handel it is necessary to initialize the library usingan .ini file.

This section of the guide assumes you have set up your instrument and configuredit with ProSpect. If you have not done this, you may follow the information inFalconX1/X4/X8 Quick Start Guide. Be sure to characterize the signal in thePulse Characterization tab and verify the spectrum before continuing. Once youhave configured the instrument, save the .ini file in ProSpect and copy it to theexample working directory. See INI Files for details on the .ini file format. 2

Once you have an .ini file, you can use it to initialize Handel with xiaInit().

CHECK_ERROR(xiaInit("falconxn.ini"));

Once the initialization is complete, the next step is to call xiaStartSystem().This is the first time that Handel attempts to communicate with the hardwarespecified in the .ini file. xiaInit()’s job is to prepare Handel for data acquisition,while xiaStartSystem()’s is to prepare the hardware.

CHECK_ERROR(xiaStartSystem());

Once xiaStartSystem() returns with the success status, Handel is ready toperform data acquisition tasks. xiaStartSystem() only needs to be called onceafter an .ini file is loaded.

Configuring Data Acquisition

After xiaStartSystem() has run, the FalconXn system is ready to be configuredfor data acquisition. If the .ini file that was loaded with xiaInit() contains a[default definitions] section, then the hardware will be configured using thosevalues. If the default definitions section is missing, then Handel uses a nominalset of default values. Default settings are sufficient for many acquisition values,but most systems will require optimization of at least the analog settings toobtain a good spectrum.

Handel provides a comprehensive set of acquisition values for controlling thesettings the FalconXn. See the Acquisition Values section for the complete list.

Most MCA data acquisition setups will only need to set the handful of valuesdescribed below. Once a working set of acquisition values has been created, theycan be saved to an .ini file using the function xiaSaveSystem().

2An earlier version of Handel saved pulse characterization data in a separate .bin file perchannel specified in a firmware definition in addition to the .ini file. The information in the.bin files is now saved in the .ini file itself. Existing .ini files are upgraded in place duringinitialization. Corresponding .bin files may be discarded after saving the system.

6

Page 7: Handel Programmer's Guide - FalconXn

The Handel routines to control acquisition values are xiaSetAcquisitionValues()and xiaGetAcquisitionValues().

The basic setup of a FalconXn system involves optimizing the following acquisitionvalues for your system.

• detection_threshold• min_pulse_pair_separation• detection_filter• scale_factor

double detection_threshold = 0.010;CHECK_ERROR(xiaSetAcquisitionValues(0, "detection_threshold", &detection_threshold));

double min_pulse_pair_separation = 25.0;CHECK_ERROR(xiaSetAcquisitionValues(0, "min_pulse_pair_separation",

&min_pulse_pair_separation));

double detection_filter = XIA_FILTER_MID_RATE;CHECK_ERROR(xiaSetAcquisitionValues(0, "detection_filter", &detection_filter));

double scale_factor = 2.0;CHECK_ERROR(xiaSetAcquisitionValues(0, "scale_factor", &scale_factor));

Note:

Handel for FalconXn does not require the “apply” step you may beused to with other XIA products. Acquisition values are appliedimmediately. However, you may call the apply operation to checkinternal consistency of parameters on the board.

GATE Veto

To support coordinating MCA data collection with other systems, eventsare collected only when the GATE input is high or low, depending onpolarity. With no GATE input connected and the default settings in-put_logic_polarity=XIA_GATE_ACTIVE_HI and gate_ignore=1, data is collectedcontinuously. If you have a GATE input connected but wish to veto datacollection, set gate_ignore=0.

The following example configures the system to collect events only when theGATE is high.

#include "handel_constants.h"

double input_logic_polarity = XIA_GATE_COLLECT_HI;double gate_ignore = 0.0;

7

Page 8: Handel Programmer's Guide - FalconXn

CHECK_ERROR(xiaSetAcquisitionValues(-1, "input_logic_polarity", &input_logic_polarity));CHECK_ERROR(xiaSetAcquisitionValues(-1, "gate_ignore", &gate_ignore));

Run Control

At this point, the hardware is properly configured and ready to acquire data. Inthis section we are interested in starting and stopping a normal MCA run andreading out the spectrum data. The routines xiaStartRun() and xiaStopRun()control the run. The run only needs to be started and stopped once per moduleon the FalconXn.

The MCA can be read either while the run is active or after it has been stopped.The MCA histogram is returned as an array of uint32_t integers via a call toxiaGetRunData()3.

xiaGetRunData() expects an array equal to (or larger) than the requested MCAlength. The MCA length is set using the “number_mca_channels” acquisitionvalue and can be read as an unsigned long by passing the name “mca_length”to xiaGetRunData() or as a double from xiaGetAcquisitionValues(). With thisin mind, a simple data acquisition session has the following basic footprint:

#include <stdlib.h>

uint32_t *mca = NULL;

unsigned long mca_length = 0;

CHECK_ERROR(xiaGetRunData(0, "mca_length", &mca_length));

mca = malloc(mca_length * sizeof(uint32_t));

if (!mca) {/* Unable to allocate enough memory. */

}

CHECK_ERROR(xiaStartRun(-1, 0));/* Collect as much data as you want. */CHECK_ERROR(xiaStopRun(-1));

CHECK_ERROR(xiaGetRunData(0, "mca", mca));/* Do something with the MCA histogram. */

free(mca);3See the Run Data section for a complete list of FalconXn run data names and data types.

8

Page 9: Handel Programmer's Guide - FalconXn

Preset Runs

A common data acquisition technique is to do a “preset” run with a fixed metricof either time or events. A normal MCA run is both started and stopped bythe host software; a preset MCA run is started by the host and stopped bythe hardware. Allowing the hardware to end the run lets the host applicationrepeatedly acquire data with similar characteristics.

The FalconXn supports three distinct preset run types: realtime, events andtriggers. The constants used to define these run types are in handel_constants.h.The realtime (XIA_PRESET_FIXED_REAL) preset run instructs the hardware torun until the specified realtime has elapsed. This time is specified in seconds.

The output events (XIA_PRESET_FIXED_EVENTS) and input events (XIA_PRESET_FIXED_TRIGGERS)preset runs complete when the specified number of input or output events havebeen collected.

double preset_realtime = 20.0;double preset_type = XIA_PRESET_FIXED_REAL;

int ignored = 0;int n_channels_done;

unsigned long run_active;

CHECK_ERROR(xiaSetAcquisitionValues(-1, "preset_type", &preset_type));CHECK_ERROR(xiaSetAcquisitionValues(-1, "preset_value", &preset_realtime));

CHECK_ERROR(xiaStartRun(-1, 0));

do {int i;

n_channels_done = 0;for (i = 0; i < TOTAL_CHANNELS_IN_SYSTEM; i++) {

CHECK_ERROR(xiaGetRunData(i, "run_active", &run_active));if ((run_active & 0x1) == 0) {

n_channels_done++;}

}

Sleep(1);} while (n_channels_done != TOTAL_CHANNELS_IN_SYSTEM);

CHECK_ERROR(xiaStopRun(-1));

/* Read out data here. */

9

Page 10: Handel Programmer's Guide - FalconXn

SCA Settings

The number of SCA regions for a given channel can be set via the acquisition valuenumber_of_scas, after which limits for each region can be set with acquisitionvalues in the format “sca{n}_[lo|hi]”, e.g. sca0_lo, sca0_hi, sca1_lo, sca1_hi.The maximum number of regions per channel varies with the hardware channelcount and should be checked by reading the run data max_sca_length.

SCA counters are output via the FalconXn’s digital output lines.Cumulative hardware counters cannot be read out via Handel, butrun data “sca” is implemented for compatibility with programs thatuse this API with other products. In the case of the FalconXn, therun data simply returns the counters by summing the bins from thecurrent run’s MCA readout. There is no IO performance benefit tobe gained by reading only the SCA data in place of the full MCA;the full spectrum is transferred over the network at regular intervalsregardless of whether MCA is accessed in user programs.

See FalconX1/X4/X8 Quick Start Guide for information on thedigital lines and configuring SCA regions in ProSpect.

The following sample demonstrates configuring the SCAs. This code shouldbe executed along with other data acquisition configuration, after starting thesystem and before starting the run.

unsigned short maxsize;double nSCAs = 2.0;char scaStr[80];

double scaLowLimits[] = {0.0, 1024.0};double scaHighLimits[] = {1023.0, 2047.0};

double SCAs[2];

/* Check the maximum number of SCAs. */status = xiaGetRunData(0, "max_sca_length", &maxsize);CHECK_ERROR(status);

ASSERT(nSCAs <= (double)maxsize);

/* Set the number of SCAs. */printf("-- Set SCAs\n");status = xiaSetAcquisitionValues(-1, "number_of_scas", (void *)&nSCAs);CHECK_ERROR(status);

/* Set the individual SCA limits. */for (i = 0; i < (int)nSCAs; i++) {

10

Page 11: Handel Programmer's Guide - FalconXn

sprintf(scaStr, "sca%d_lo", i);status = xiaSetAcquisitionValues(-1, scaStr, (void *)&(scaLowLimits[i]));CHECK_ERROR(status);

sprintf(scaStr, "sca%d_hi", i);status = xiaSetAcquisitionValues(-1, scaStr, (void *)&(scaHighLimits[i]));CHECK_ERROR(status);

}

/* Read out the SCAs during or after a run as follows.* If you change the number of SCAs dynamically, check run* data "sca_length" and reallocate SCAs accordingly.*/

status = xiaGetRunData(0, "sca", SCAs);CHECK_ERROR(status);

for (int i = 0; i < (int)nSCAs; i++) {printf(" SCA%d = %0.0f\n", i, SCAs[i]);

}

Cleanup

The last operation that any Handel application must do is call xiaExit() torelease all hardware and OS resources used by the library.

printf("Cleaning up Handel.\n");CHECK_ERROR(xiaExit());

Once xiaExit() is called a new system must be loaded with xiaInit() if you wantto use Handel again.

Mapping Mode

The FalconXn supports high-speed mapping operations. The current packagedrelease can store full spectra for each mapping pixel (MCA mode). The hardwarealso supports time-stamped events (List-mode); this will be supported in Handelin a later version. In general, the controls are the same for each mapping modevariant though different strategies may be required for performance reasons.

The FalconXn hardware streams mapping data to the host computer continuously.Handel controls data readout to the client application via an a/b buffering systemconsistent with the APIs used to control the XMAP. The system allows forcontinuous mapping data acquisition by organizing memory into two independentbanks called buffer ‘a’ and buffer ‘b’. A single buffer can be read out by the

11

Page 12: Handel Programmer's Guide - FalconXn

client while the other is filled during data acquisition. Each buffer consists of aseries of 16-bit header words followed by 32-bit spectra or list mode events (seeFalconXn Mapping Buffer Specification for details). Handel limits the buffers to1024 pixels per buffer and 2ˆ32 pixels per run.

For continuous mapping, the host computer must be able to read out and clearan entire buffer for all of the modules in the system in less time then it takes tofill one buffer. The minimum pixel dwell time for continuous mapping operationis defined by the readout speed, the buffer clear time, the number of pixels thatcan be stored in one buffer and the size of the system. XIA targets a minimumpixel dwell time around 1 ms / pixel; some tuning of the system parameters anda dedicated network is required to achieve this performance.

Pixel Advance Modes

The FalconXn supports GATE pixel advance and host control.

GATE

The primary method for advancing the pixel is to use the GATE input as a pixelclock, where the pixel number advances on a defined edge transition of the inputsignal. The default setting is to use the high-to-low transition to trigger the pixeladvance. “input_logic_polarity” can be set to 1.0 if the low-to-high transitionis desired instead. Since the GATE signal requires transitions from high-to-low(or low-to-high), there is necessarily a transition time between states where dataacquisition is inhibited. The default setting, controlled with the “gate_ignore”acquisition value, is to ignore the data during the transition period. Howeverif “gate_ignore” is set to 1.0, data acquisition will remain active during thetransition.

Host Control

It is possible to advance the pixel directly in Handel using the board operation“mapping_pixel_next”. Manually advancing the pixel is slower and does notprovide good real-time control and, as such, is suitable only for debugging andevaluation purposes.

Using Mapping Mode: A Walkthrough

Mapping mode and detChans

Mapping operations such as pixel advance, buffer monitoring, andbuffer readout must be performed on each channel in the system.

12

Page 13: Handel Programmer's Guide - FalconXn

This is a departure from the model of other XIA products such asXMAP, in which many such tasks operate at a module level and onlyrequire calls for one channel per module.

Acquisition values may always be applied to the entire system, sothe walkthrough that follows passes detChan=-1 to those calls.

Where detChan=0 is passed, a production application should loopover all the modules and channels and perform the operation for eachchannel. See Enumerating Modules and Channels for code examplesdemonstrating how to identify the detChans to pass to the calls.

Enable mapping mode

Setting the acquisition value “mapping_mode” while data acquisition is stoppedswitches the system between the various modes. Handel for FalconXn supportsMCA mapping mode (1.0). To switch back to normal MCA data acquisition, set“mapping_mode” to 0.0.

double mode = 1.0;CHECK_ERROR(xiaSetAcquisitionValues(-1, "mapping_mode", &mode));

Set the number of bins in the spectrum

The number of bins in the spectrum affects the overall size of the buffer for agiven number of pixels and the overall performance of the system in terms ofpixels per second network throughput.

double nBins = 4096.0;CHECK_ERROR(xiaSetAcquisitionValues(-1, "number_mca_channels", &nBins));

Set the total number of pixels to be acquired in this run

Handel limits the total number of pixels to 2ˆ32. This value can also be set to0.0 if data acquisition should continue indefinitely.

double nMapPixels = 100.0;CHECK_ERROR(xiaSetAcquisitionValues(-1, "num_map_pixels", &nMapPixels));

Set the number of pixels per buffer

The number of pixels in a single buffer may be set between 1 and 1024. 4 If thenumber of mapping pixels per buffer is set larger then the maximum amount

4The maximum, which is limited in the XMAP by hardware memory, is an arbitrarysoftware-imposed constraint for FalconXn, limited only by host process memory, the spectrumsize, and the number of channels in the system. 1024 provides a safe general limit in practice,

13

Page 14: Handel Programmer's Guide - FalconXn

the buffer can hold, it will be truncated to the maximum value. Passing -1.0 or0 instructs Handel to use the maximum size.

double nMapPixelsPerBuffer = -1.0;CHECK_ERROR(xiaSetAcquisitionValues(-1, "num_map_pixels_per_buffer",

&nMapPixelsPerBuffer));

Configure pixel control

At the beginning of the run, the pixel number starts at 0 and is advanced usingone of the techniques discussed in the section Pixel Advance Modes.

GATE

#include "handel_constants.h"

double pixelMode = XIA_MAPPING_CTL_GATE;CHECK_ERROR(xiaSetAcquisitionValues(-1, "pixel_advance_mode", &pixelMode));

HOST

Manual pixel advance from the host is always available and does not need to beexplicitly configured. To advance the pixel, use the following code:

int ignored = 0;CHECK_ERROR(xiaBoardOperation(0, "mapping_pixel_next", &ignored));

As mentioned in the note at the beginning of this walkthrough, mapping dataacquisition tasks such as pixel advance and all tasks demonstrated here passingdetChan=0 need to be call once for each channel in the system.

Get the buffer length

After all of the settings are applied, Handel can be queried for the size of areturned buffer. This value can then be used to allocate the appropriate amountof memory.

unsigned long bufferLength = 0;uint32_t *buffer = NULL;CHECK_ERROR(xiaGetRunData(0, "buffer_len", &bufferLength));

buffer = malloc(bufferLength * sizeof(uint32_t));if (!buffer) {requiring up to approximately 32 MB host memory per channel for full 4096 bin spectra(ignoring buffer and pixel headers: 1024 pixels * 4096 bins * 4 bytes * 2 buffers = 33,554,432bytes).

14

Page 15: Handel Programmer's Guide - FalconXn

/* Out-of-memory */}

Start the run

CHECK_ERROR(xiaStartRun(-1, 0));

Monitor the buffer status

Once the run is started, pixels are added to the first buffer (‘a’) until it is full.To see if the buffer is full, use the following code:

int isFull = 0;

while (isFull == 0) {CHECK_ERROR(xiaGetRunData(0, "buffer_full_a", &isFull));

/* Sleep for a short time here using a routine like Sleep() on win32* or usleep() on linux.*/

}

Each channel in the system should be polled to determine when all of the channelsare ready to be read.

Read full buffer

/* Assumes that buffer was previously allocated. */CHECK_ERROR(xiaGetRunData(0, "buffer_a", buffer));

Signal that the read has completed

Once a buffer is read, it is important to let Handel know that it is availableto be filled again. Failure to do this in a timely manner can potentially causeoverrun errors.

char currentBuffer = 'a';

CHECK_ERROR(xiaBoardOperation(0, "buffer_done", &currentBuffer));

Wait for buffer ‘b’ to fill

With buffer ‘a’ read and signaled as done, the next step is to wait for buffer ‘b’.

15

Page 16: Handel Programmer's Guide - FalconXn

int isFull = 0;

while (isFull == 0) {CHECK_ERROR(xiaGetRunData(0, "buffer_full_b", &isFull));

/* Sleep for a short time here using a routine like Sleep() on win32* or usleep() on linux.*/

}

Then signal “buffer_done” using the same board operation call as for the ‘a’buffer.

Repeat until all the pixels are collected

Continue reading, signaling complete and polling while switching between buffers‘a’ and ‘b’. You may monitor the for run completion by manually checking thepixel number:

unsigned long nMapPixels; /* As set above. */unsigned long currentPixel;CHECK_ERROR(xiaGetRunData(0, "current_pixel", &currentPixel));

if (currentPixel >= nMapPixels) {/* The run is complete. Break the monitoring loop and continue. */

}

Or simply monitor the run status as in normal MCA data acquisition:

unsigned long runActive;CHECK_ERROR(xiaGetRunData(0, "run_active", &runActive));

if (!runActive) {/* The run is complete. Break the monitoring loop and continue. */

}

Stop the run

Once all of the pixels have been collected, the run must be stopped as usual.

CHECK_ERROR(xiaStopRun(-1));

Mapping Tips

This section describes (and reiterates) various tips and techniques to make surethat your mapping application runs smoothly.

16

Page 17: Handel Programmer's Guide - FalconXn

1. Enabling mapping mode updates all parameters

When “mapping_mode” is enabled, all of the relevant acquisition valuesare applied to the hardware. There is no need to set these values eachtime you enable mapping mode. You may set them before or after actuallysetting “mapping_mode”.

2. Set acquisition values for the system

Acquisition values related to mapping mode do not vary by channel (as,for example, gain or threshold settings may), so for convenience set valuessuch as “num_map_pixels” once using detChan -1.

3. Perform mapping operations once per detChan

Mapping operations during data acquisition, such as checking if a buffer isfull, reading a buffer, and signaling a buffer is done, must be performedonce for each detChan in the system. In the XMAP all of these operationswere module-wide, but Handel for FalconXn tracks buffers at the channellevel.

4. Cache the mapping buffer length

For all modes except for list-mode, the mapping buffer length, retrievedby passing “buffer_len” to xiaGetRunData(), only needs to be read oncebefore the mapping run starts; it will not change once the run is active.

5. Check for buffer overruns

If the per-pixel dwell time is too short for the FalconXn to keep up pushingthe data across the network or for the client application to read out andprocess the buffers, it is possible to overrun a buffer. To signal that thebuffer is overrun the value of the run data “buffer_overrun” will be set to1.0.

XIA recommends treating the buffer overrun condition as an indicationthat the system requires additional tuning to run with the dwell time thatcaused the overrun.

Acquisition Values

This section lists the allowed names for use with xiaGetAcquisitionValues() andxiaSetAcquisitionValues().

Analog Section

Acquisition values controlling the analog front end.

17

Page 18: Handel Programmer's Guide - FalconXn

analog_gain Acts as as a gain multiplier on the analog front end. Range:[1,16].

analog_offset Sets the offset on the analog front end. Range: [-2048, 2047].

detector_polarity The input signal polarity, specified as 1 for positive or 0for negative. Setting to 0 effectively inverts the signal.

This value is a copy of the channel{n}_polarity setting in the [detectordefinitions] section of the INI file. On startup, the detector definition takesprecedence over the acquisition value, so if you are customizing an INI fileby hand, you must edit the detector definition or both values, not onlythe acquisition value. To modify the value in your application at runtime,however, you must set the acquisition value using xiaSetAcquisitionValues();the value will be synced to the detector definition to preserve the changewhen the system is saved.

termination Input termination impedance. 0=1kohm, 1=50ohm. Default: 0.

Note that newer versions of FalconXn hardware don’t support50ohm termination. The support can be verified by checking bitBOARD_SUPPORTS_TERMINATAION_50OHM returned fromxiaBoardOperation() get_board_features

attenuation Input attenuation. 0=0dB, 1=-6dB, 2=ground. Default: 0.

Note that newer versions of FalconXn hardware don’t support‘ground’ attenuation, instead the values are mapped to: 0=0dB,1=-6dB, 2=-12dB. The support can be verified by checking bitBOARD_SUPPORTS_ATTENUATION_GROUND returned fromxiaBoardOperation() get_board_features

coupling AC or DC coupling. 0=AC, 1=DC. Default: 0.

decay_time This setting applies to AC coupling mode. Default: 0.

• XIA_DECAY_LONG• XIA_DECAY_MEDIUM• XIA_DECAY_SHORT• XIA_DECAY_VERY_SHORT

dc_offset Digital DC offset. Range: [-1, 1]

auto_dc_offset Automatically calculate dc_offset on StartSystem. This op-tion ensures that dc_offset is up to date, but will slow down starting upby roughly one second per channel. 0 = disabled, 1 = disabled. Default:enabled.

reset_blanking_enable Enables reset blanking. 1 = enabled, 0 = disabled.Default: enabled.

reset_blanking_threshold The threshold for reset blanking, in arbitraryunits. Range: [-0.99999, 1.0]. Default: -0.05.

18

Page 19: Handel Programmer's Guide - FalconXn

reset_blanking_presamples Number of samples before reset detection toblank. Range: [4, 125]. Default: 50.

reset_blanking_postsamples Number of samples after reset detection toblank. Range: [4, 1000]. Default: 50.

clock_speed Read-only value to get the sample rate in MHz.

adc_trace_decimation Read-only value indicating adc_trace run data sam-ple period as a multiple of the actual ADC rate. To determine the pe-riod for data returned in adc_trace, invert clock_speed and multiplyby adc_trace_decimation. For example, if clock_speed=250MHz andadc_trace_decimation=2, the ADC sample period is 1 / (250 * 1,000,000)= 4ns. The adc_trace is returned in 4ns * 2 = 8ns samples.

Pulse Detection

Acquisition values controlling pulse detection.

detection_threshold Minimum height for a pulse to be detected. Range: [0,0.999]. Default: 0.05.

min_pulse_pair_separation Minimum number of samples between pulses.This setting controls the balance of throughput and resolution. Range: [0,1023]. Default: 50.

risetime_optimization Advanced tuning of throughput and resolution fordetectors with slow or varying rise times, specified in nanoseconds. Adefault is chosen based on the detection filter. The value is optimized bythe characterization process, so manual tuning should be applied aftercharacterizing the signal. Increase to improve resolution, decrease toimprove throughput. Range: [0 - 4000], typically in the lower end of [40 -100] for fast SDDs. Added in Handel 1.1.18, requires SiToro 0.9.0.

detection_filter Default: XIA_FILTER_MID_RATE.

• XIA_FILTER_LOW_ENERGY• XIA_FILTER_LOW_RATE• XIA_FILTER_MID_RATE• XIA_FILTER_HIGH_RATE• XIA_FILTER_MAX_THROUGHPUT

scale_factor Scale factor for bin scaling and spectrum calibration. Range:[0.5, 200.0]. Default: 2.0.

MCA Data Acquisition

Acquisition values controlling MCA data acquisition.

19

Page 20: Handel Programmer's Guide - FalconXn

number_mca_channels The number of bins in the MCA spectrum, speci-fied in bins. This applies to both MCA mode and fast mapping mode.Narrowing the range may improve network performance in fast mappingapplications. Range: [128, 4096]. Default: 4096.

mca_spectrum_accepted Whether to return the accepted spectrum in mca.The accepted spectrum is the standard MCA histogram and so must beenabled in any typical spectroscopy application.

mca_spectrum_rejected Whether to return the rejected spectrum in mca.The rejected spectrum consists of pulses that triggered but were rejecteddue to the detection threshold or other pulse processing criteria. It isavailable for diagnostics purposes only, and, if enabled, is appended on theend of the mca buffer readout. If both the accepted and rejected spectraare enabled, the application must allocate a buffer that is twice the lengthof number_mca_channels.

mca_start_channel The lowest bin number in the range of MCA bins toreturn. This may be used in conjunction with number_mca_channelsnumber_mca_channels to narrow the range the range of bins and improvenetwork performance but is not needed in typical applications. Default: 0.

mca_refresh MCA refresh period in seconds. This controls how often MCAupdates are sent from the FalconXn to the client machine. Default: 0.1.

mca_bin_width MCA bin width in eV/bin. This value is not used to configurethe FalconXn but may serve as convenient storage for a multiplier valuefor scaling graphical axes in user programs.

preset_type Criteria to stop the run. Include handel_constants.h to accessconstants for the allowed values:

• XIA_PRESET_NONE: run indefinitely• XIA_PRESET_FIXED_REAL: run for a fixed elapsed time. Set pre-

set_value in seconds.• XIA_PRESET_FIXED_EVENTS: run until a fixed number of output pulses

are counted. Set preset_value to the number of events.• XIA_PRESET_FIXED_TRIGGERS: run until a fixed number of input

pulses are counted. Set preset_value to the number of triggers.

preset_value Preset run criteria specified in counts or seconds. Required whenpreset_type is anything other than XIA_PRESET_NONE.

SCA Data Acquisition

sca_trigger_mode Include handel_constants.h to access constants for theallowed values:

• SCA_TRIGGER_OFF

20

Page 21: Handel Programmer's Guide - FalconXn

• SCA_TRIGGER_HIGH• SCA_TRIGGER_LOW• SCA_TRIGGER_ALWAYS

sca_pulse_duration Duration of the emitted SCA pulses in ns, will berounded to multiple of 4ns. Range: [4, 262140]. Default: 400.0.

number_of_scas Number of SCA regions to configure for the channel. Theupper limit varies by hardware setup. Read the run data max_sca_lengthfor the maximum number of SCA regions supported per channel.

sca SCA limits are defined by pairs of acquisition values with names of theformat sca{n}_[lo|hi], where n refers to the 0-indexed SCA number. Forexample: sca0_lo, sca0_hi, sca1_lo, and sca1_hi.

Mapping Mode

mapping_mode Toggles between the various mapping modes. Supportedvalues are as follows:

• 0.0 = mapping mode disabled• 1.0 = MCA mapping mode

num_map_pixels Total number of pixels to acquire in the next mappingmode run. If set to 0.0, then the mapping run will continue indefinitely.

num_map_pixels_per_buffer The number of pixels stored in each bufferduring a mapping mode run. If the value specified is larger then themaximum number of pixels the buffer can hold, it will be rounded down tothe maximum. Setting this to -1.0 or 0.0 will automatically set the valueto the maximum allowed per buffer.

pixel_advance_mode Sets the pixel advance mode for mapping mode. Thesupported types are listed in handel_constants.h. Manual pixel advanceusing xiaBoardOperation() is always available; use XIA_MAPPING_CTL_USERis the default and can be used to explicitly disable GATE processing onthe FalconXn.

• XIA_MAPPING_CTL_USER• XIA_MAPPING_CTL_GATE

input_logic_polarity When running in mapping mode and pixel_advance_modeis set to use the GATE signal, this acquisition value determines whichlogic transition stops data acquisition and clears the spectrum for the nextpixel.

• XIA_GATE_COLLECT_HI: acquire data while the GATE signal is highand trigger pixel advance on the high-to-low transition. If gate_ignoreis set to 1.0, continue collecting data during the transition period.

21

Page 22: Handel Programmer's Guide - FalconXn

• XIA_GATE_COLLECT_LO: acquire data while the GATE signal is lowand trigger pixel advance on the low-to-high transition. If gate_ignoreis set to 1.0, continue collecting data during the transition period.

In MCA mode, this setting determines the polarity of the GATE veto withthe same collect high or collect low semantics.

gate_ignore Determines if data acquisition should continue or be halted duringpixel advance while GATE is asserted. Set to 1.0 to keep data acquisitionactive during the transition or 0.0 to halt acquisition while the GATE isasserted. Default: 1.0 (continuous data collection). In MCA mode, set to1.0 to disable GATE veto and enable continuous data collection or 0.0 touse the GATE signal to veto data collection.

sync_count Sets the number of SYNC pulses to use for each pixel. Once“sync_count” pulses have been detected, the pixel is advanced.

Run Data

This section lists the allowed names for use with xiaGetRunData().

The italicized type that follows each name is the type of the argument passedinto the value parameter of xiaGetRunData(). For scalar values, you will needto pass a pointer to the specified type. For array values, a pointer is specifiedand the address of the first element should be passed. See xiaGetRunData() forusage examples.

Status

run_active (unsigned long) The current run status for the specified channel.If the value is non-zero then a run is currently active on the channel.

MCA Data

mca_length (unsigned long) The current size of the MCA data buffer forthe specified channel.

mca (uint32_t *) The MCA data array for the specified channel. The calleris expected to allocate an array of length mca_length and pass that in asthe value parameter when retrieving the MCA data.

module_statistics_2 (double *) Returns an array containing statistics forthe module. The caller is responsible for allocating enough memory for atleast 9*n elements (where n is the number of channels in the module) and

22

Page 23: Handel Programmer's Guide - FalconXn

passing it in as the value parameter. The returned data is stored in thearray as follows:

0. channel 0 realtime1. channel 0 trigger livetime2. reserved3. channel 0 triggers4. channel 0 MCA events5. channel 0 input count rate6. channel 0 output count rate7. reserved8. reserved

[repeat for channels 1-7]

SCA Data

max_sca_length (unsigned short) The maximum number of SCA elementssupported by the system per channel. Twenty-four digital output lines aredivided among channels according to the size of the module in availablechannels, which is the module size you purchased, or, if changed via theFalconX web interface Config tab, the number set there. Board operationget_channel_count reports the available channels.

Available channels Max SCAs per channel1 242-4 65-8 3

Devices with earlier firmware releases (SiToro 0.8.3) configured only 16digital outputs while incorrectly reporting a max_sca_length as though 24total outputs were available. With such devices the application may workaround the incorrect max by self-limiting the max SCAs per channel to 16/n.This limitation is corrected in SiToro 0.8.4 and later; if only up-to-datedevices are used, the application should simply check max_sca_length.

sca_length (unsigned short) The number of elements in the SCA databuffer.

sca (double *) The SCA data buffer. The caller is expected to allocate anarray of length “sca_length” and pass that in as the value parameterwhen retrieving the SCA data. The FalconX only outputs SCA pulses onthe digital output lines and does not support readout from the electronics.Therefore this SCA data is emulated by summing MCA bins.

23

Page 24: Handel Programmer's Guide - FalconXn

Mapping Mode

Note to customers porting XMAP or Mercury code: The FalconXndriver promotes the type of the boolean mapping mode run data values such asbuffer_full_a from unsigned short to int. To support both Handel versionswith the same client code, XIA recommends using int for the flags and checkingwhether the value is greater than zero, rather than checking a literal value.

buffer_len (unsigned long) The size of a mapping buffer. For a given map-ping run, this value will remain constant and, therefore, only needs to readonce at the start of the run.

buffer_full_a (int) The current status of buffer ‘a’. If the value is non-zerothen the buffer is full.

buffer_full_b (int) The current status of buffer ‘b’. If the value is non-zerothen the buffer is full.

buffer_a (uint32_t *) The data in buffer ‘a’. The caller is expected toallocate an array of length “buffer_len” and pass that in as the valueparameter when retrieving the buffer data.

buffer_b (uint32_t *) The data in buffer ‘b’. The caller is expected toallocate an array of length “buffer_len” and pass that in as the valueparameter when retrieving the buffer data.

current_pixel (unsigned long) The current pixel number. The number isreset to 0 at the start of each new mapping run.

buffer_overrun (int) If non-zero, indicates the the current buffer has over-flowed.

Special Runs

This section lists the allowed names for use with xiaDoSpecialRun(). Data typesare specified as in Run Data. See xiaDoSpecialRun() for usage examples.

adc_trace (double) Configures an ADC trace. The argument info isthe number of samples to collect. The allowed range of values is 0- FALCONXN_MAX_ADC_SAMPLES. If an out-of-range value is provided,it is coerced into the allowed range, so users should check it afterxiaDoSpecialRun() returns successfully. To size the array passed toxiaGetSpecialRunData(), use the value returned in info or get the rundata adc_trace_length.

The trace is triggered and read to the host when xiaGetSpecialRunData()is called.

calc_dc_offset (none)5 Starts a DC offset calculation for the channel. Thecalculation runs asynchronously and takes around half a second to complete.The function returns immediately, allowing the caller to do other work.Call xiaGetSpecialRunData() to block to completion and return the result.

24

Page 25: Handel Programmer's Guide - FalconXn

It is allowed to do the special run for multiple channels concurrently, butthere is no speedup advantage to doing so.

Special Run Data

This section lists the allowed names for use with xiaGetSpecialRunData(). Datatypes are specified as in Run Data. See xiaGetSpecialRunData() for usageexamples.

adc_trace (unsigned int *) Reads out an array of ADC trace samples. Thecaller is responsible to allocate an array as long as the length valuepassed back from xiaDoSpecialRun() (or by subsequently reading rundata adc_trace_length).

adc_trace_length (unsigned long) Gets the length set by the last call toxiaDoSpecialRun(), for use in sizing the array passed to get special rundata adc_trace.

dc_offset (double) Gets the DC offset calculated by the last special runcalc_dc_offset. Use this to block to completion of the calculation and getthe result. The result is only current if the special run was called. To getthe DC offset any other time, use xiaGetAcquisitionValues();

Board Operations

This section lists the allowed names for use with xiaBoardOperation(). Datatypes are specified as in Run Data. See xiaBoardOperation() for usage examples.

Settings and Capabilities

apply (none)6 Acquisition values are applied immediately by xiaSetAcquisi-tionValues(). The apply operation may be called as a debugging step tocheck internal consistency of the parameters on the board.

get_connected (int) Pings the FalconXn and returns greater than zero if itis connected. This is provided for diagnostics purposes but may not beneeded in typical applications, as the other Handel APIs will return errorsif the connection has been lost.

get_channel_count (int) Returns the number of channels supported bythe connected FalconXn. This is provided for diagnostics purposes only.number_of_channels as specified in the Handel .ini file is the official numberof channels initialized for use in the APIs.

get_serial_number (char *) Returns the serial number as a string. Thecaller is responsible for allocating value of length at least 32.

25

Page 26: Handel Programmer's Guide - FalconXn

get_firmware_version (char *) Returns the firmware version as a string.The caller is responsible for allocating value of length at least 32.

get_board_features (unsigned long) Returns an unsigned long value stor-ing a list of supported features, represented by bitmasks defined in han-del_constants.h.

• BOARD_SUPPORTS_TERMINATAION_50OHM• BOARD_SUPPORTS_ATTENUATION_GROUND

Mapping Mode

buffer_done (char) Signal that the specified buffer (‘a’ or ‘b’) has been readand may be used for mapping acquisition again.

mapping_pixel_next (none) Advance to the next pixel in a mapping dataacquisition run. This is generally used only for evaluation and debuggingpurposes, as production applications should rely on the GATE signal forpixel advance.

INI Format

Each category in the .ini file contains a series of blocks, surrounded by a set ofSTART / END delimiters. Each block represents one instance of the logical typeassociated with the category. For instance, each block in [detector definitions]represents a physical detector with some number of elements. Within each blockis a series of key-value pairs used to define the configuration.

[detector definitions]

Each block in this section is used to define one physical detector made up of1..N channels.

alias Human-readable string naming this detector. Other sections, such as[module definitions], that need to reference the detector will do so usingthis string.

number_of_channels An integer describing the number of elements in yourdetector. If this value is set to N, the strings {alias}:{0} through{alias}:{N - 1} will be available to map detector elements to hardwarechannels in the [module definitions] section.

type The detector type. This field remains in the format for backward compat-ibility but is not used for the FalconXn. Supported values are the stringsreset and rc_feedback.

26

Page 27: Handel Programmer's Guide - FalconXn

type_value For reset detectors, a double defining the reset delay time ofthe preamplifier(s) in microseconds. For rc_feedback detectors, a doubledefining the RC decay constant in microseconds.

channel{n}_gain The preamplifier gain, as a double, for detector element nspecified in mV/keV.

channel{n}_polarity A string defining the polarity of detector element n.Allowed values are “+” or “pos” for a preamplifier whose pulses are positiveand “-” or “neg” for one with negative pulses.

[firmware definitions]

This section is not used for the FalconXn. An earlier version of Handel definedeach block in this section as a reference to a single .bin file, a text file containingpulse characterization information used to optimize spectroscopic performancefor a particular detector and configuration. As of v1.1.17 this information is nowupgraded in place and saved in the .ini file itself.

Note:

FalconXn differs from other XIA products and their use of thisconfiguration section in that it does not require firmware to beloaded during system startup (firmware resides on the card).

alias Human-readable string naming this characterization file. Other sections,such as [module definitions], that need to reference the detector will do sousing this string.

filename Path to the .bin file. The path must be an absolute path or relativeto the process working directory.7

[default definitions]

All of the acquisition values8 for each channel are stored in this section. Handelauto-generates this section and the user is not expected to modify it.

[module definitions]

Each FalconXn module in a system gets a separate block in this section. Theblocks map each FalconXn channel to firmware, acquisition values, and a detectorchannel, and specify the hardware configuration for each module.

alias Human-readable string naming this module.module_type Always set to falconxn.

7We plan to encode support paths relative to the INI file in a future release.8The original name for acquisition values was “defaults”.

27

Page 28: Handel Programmer's Guide - FalconXn

number_of_channels Set to 1-8, depending on the number of channels sup-ported by your FalconXn and how many of them you would like to use.

interface Always set to inet.inet_address TCP address of the FalconXn.inet_port TCP port of the data acquisition server on FalconXn. Typically set

to 8756.inet_timeout TCP timeout in milliseconds. 100 milliseconds should suffice

on a fast network, which is desirable for reliable data acquisition, butif timeout errors are returned from Handel APIs you can increase thisnumber.

channel{n}_alias Specifies a global, unique index for channel n, where n is 0.. N-1. This could be This value is referenced throughout Handel as thedetChan.

channel{n}_detector Associates channel n, where n is 0 .. N-1, with a specificdetector element. The detector element is referenced as {alias}:{m} wherealias is a valid detector alias and m is a valid channel for alias.

firmware_set_chan{n} Assigns a .bin file to module channel n, where n is0..N-1. The .bin file is specified as a firmware alias.

Legal

Copyright 2005-2018 XIA LLC

All rights reserved

All trademarks and brands are property of their respective owners.

Licenses

Handel

Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met:

• Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.

• Redistributions in binary form must reproduce the above copy-right notice, this list of conditions and the following disclaimerin the documentation and/or other materials provided with thedistribution.

• Neither the name of XIA LLC nor the names of its contributorsmay be used to endorse or promote products derived from thissoftware without specific prior written permission.

28

Page 29: Handel Programmer's Guide - FalconXn

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERSAND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIEDWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PAR-TICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THECOPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, ORCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OFUSE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CON-TRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCEOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCHDAMAGE.

Documentation

Redistribution and use in source (Markdown) and ‘compiled’ forms (HTML,PDF, LaTeX and so forth) with or without modification, are permitted providedthat the following conditions are met:

• Redistributions of source code (Markdown) must retain theabove copyright notice, this list of conditions and the followingdisclaimer as the first lines of this file unmodified.

• Redistributions in compiled form (transformed to other DTDs,converted to PDF, PostScript, HTML, LaTeX, RTF and otherformats) must reproduce the above copyright notice, this list ofconditions and the following disclaimer in the documentationand/or other materials provided with the distribution.

THIS DOCUMENTATION IS PROVIDED BY XIA LLC “AS IS” AND ANYEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITEDTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-NESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENTSHALL XIA LLC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTER-RUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OR OTHERWISE) ARISING IN ANYWAY OUT OF THE USEOF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITYOF SUCH DAMAGE.

29

Page 30: Handel Programmer's Guide - FalconXn

Disclaimer

Information furnished by XIA LLC is believed to be accurate and reliable.However, XIA assumes no responsibility for its use, nor any infringements ofpatents or other rights of third parties, which may result from its use. No licenseis granted by implication or otherwise under any patent or patent rights ofXIA. XIA reserves the right to change specifications at any time without notice.Patents have been applied for to cover various aspects of the design of the DXPDigital X-ray Processor.

Patents

Patent Notice

30