MCA Data Server Reference

COUNTER

Introduction

USB driver

Counter Device

Data structures

Overview

Module Constants

ARM Data structures

Version

Status

Controls

Calibration

Two-channel Logger

Time histogram

API

Overview

Counter Data Structure: arm_logger

Summary

The arm_logger is implemented in an 8kB general purpose region of memory. For example users can log the change in operating voltage in response to a rapid change of count rate – to verify that the gain remains stable in such circumstances. Or the user may log net counts over background and the resulting alarm probability – to study the performnace of the portal monitor alarm function. In case custom software is implemented on device the logger size may be reduced, or the logger may be omitted altogether.

The logger can be used to monitor rapidly changing parameters in time intervals ranging from 50ms to 12.75s. The logger creates running logs for two parameters. The parameters are chosen by the their index in the arm_status register. The parameter index is also indicated in the wxMCA arm_status table.

Programming the logger
Bit ranges in the 24-bit xctrl_0 bit fieldDescription
[0:7]: dwell_timeTime interval for each logger time step. time_step = dwell_time * 50ms; 1≤dwell_time≤255
[8:15]: index_1Index of the first variable in arm_status
[16:23]: index_2Index of the second variable in arm_status
Use the arm_ctrl[xctrl_0] field to program the logger. Example: Record alarm status (idx=21) vs net counts above background (idx=22) in 100ms (=2*50ms) steps: xctrl_0 = (21<<16) + (22<<8) + 2. For this example, the time_slice operation must be turned on; cf arm_ctrl["user"]["time_slice"]=1.

Associated commands

The logger automatically starts, or resumes from where it last stopped, when xctrl_0 is non-zero. Setting xctrl_0=0 halts the logger.

To reset the logger set arm_ctrl["user"]["clear_logger"]=1 and issue a read-modify-write (rmw) command to the MDS.

Data structure

The logger has a fixed two-word header, followed by 2×1023 data words. All entries are 4-byte float numbers.

The logger is organized as a two-word header followed by two circular buffers with logger_length-1 entries each. In each time step the logger writes a parameter_1 and parameter_2 value to the respective circular buffer. When the buffers are full, the logger continues writing at the beginning of the buffer, overwriting old data. The two-word header, however, is preserved.

Logger data structure – registers
Word indexDescription
0: logger_lengthHalf the number of 4-byte data words in the entire logger memory; typically 1024
1: endArray index of last entry into the logger; 0≤end≤logger_length-1
[2: logger_length]: par_1Data for parameter 1
[logger_length+1: 2*logger_length-1]: par_2Data for parameter 2
Structure of the logger data array.
Logger data structure – fields
Field nameDescription
lengthHalf the number of 4-byte data words in the entire logger memory; typically 1024
endArray index of last entry into the logger; 0≤end≤logger_length-1
var_0Data for parameter 1 as read from the device
var_1Data for parameter 2 as read from the device
Structure of the logger data reported by the MDS in the fields dictionary.

The MCA Data Server (MDS) provides time-orded data lists for both parameters. For example, a value of end=200 indicate that the last new entry was at index 200. Hence, the oldest data point is at index 201. In the user record the MDS presents the data in correct time order with the oldest datum now at index 0. In this example user["var_0"] = fields["var_0"][201:1023] + fields["var_0"][0:201]. Here indices are in Python notation; ie highest index is not part of the selection.

Note that a logger_length=1024 means that there are two circular buffers with 1023 entries each; ie one less than the logger_length.

Logger circular buffer example
Logger data structure – user
user entryDescription
lengthHalf the number of 4-byte data words in the entire logger memory; typically 1024
var_0Time-ordered data for parameter 1 with oldest data at index 0
var_1Time-ordered data for parameter 2 with oldest data at index 0
Structure of the logger data reported by the MDS in the user dictionary.