The project relied on being able to attach absolute timestamps to neutron detection, motors, and ancillary equipment events. The instrument control program, NICE, interfaces with sample environments in a robust fashion (fault-tolerant; plug-n-play), these sample environments can be controlled by NICE and participate in the timing infrastructure. This means that only one driver is programmed into NICE to operate across all compatible sample environments (see CHRNS: Stopped flow capabilities for an example). The SECoPs-like environment is flexible (C++, Python, and LabVIEW libraries on Windows, Linux, and OSX), and expands the programming capabilities outside of the NICE team and allows users to program their own equipment, and provides a reduced barrier to enabling experiments (CHRNS staff can help as necessary!)
To achieve the highest timing resolution needed for certain experiments (e.g., relaxation microwave excitations on magnetic monopoles on MACS), the timing requirements are in the microsecond regime and unsuitable for most operating systems. Given these stringent requirements, we adopted the real-time capabilities of the National Instruments CompactRIO (cRIO) as the primary sample-environment controller.
Neutron capture events (and all other events) are timestamped using the Precision Time Protocol (PTP) using a master GPS clock at the NCNR (time.ncnr.nist.gov). MACS, CANDOR, and VSANS all required modifications to the detection hardware to enable these capabilities. While it is relatively straightforward on MACS (and we had prior experience implementing this on DCS and prototyping for this experiment), the other two instruments required bespoke solutions with the requisite prototyping, testing, troubleshooting, and final design and manufacturing of components. The final product is a flexible Multipurpose Absolute Time Synchronizer Scaler Equipment (MATISSE) deployed on the instruments.
An experiment further requires Instrument configurations (defined essentially by motor and servo positions) and other meta-data from NICE (user information, experiment title, measurement intent, start/stop counts etc.). Motor positions are available from the updated VIPER program across the facility.
All events from their respective sources are captured as information packets and transmitted to our Redpanda messaging system (based on Apache Kafka). This scalable system, installed on the newest computer hardware, allows us to define a series of self-describing data streams based on common schemas. We have developed real-time data and parameter visualization, and data treatment for users.
Any neutron and sample environment timed series of events has to be brought in to coincidence using data reduction/analysis. The delay between the neutron interacting with the sample and its detection needs to be known. Similarly, the uncertainty in the neutron time-of-flight sets an upper bound on the maximum achievable time resolution. For velocity selector instruments, the resolution is low due to a large δλ/λ, while for crystal monochromator/analyzer instruments, this depends on the crystal and mosaic properties. A full McStas simulation of MACS was performed to characterize these parameters (and it also allows the full dynamics instrument resolution to be calculated). A summary of results is given in the following table.
| Instrument | Configuration | t (delay) (ms) | ≈Resolution, δt (ms) |
| MACS | Any | 1-to-2 | >0.01 |
| CANDOR | Closest dets. | 4.6 | 0.03 |
| Furthest det. | 5.4 | 0.01 | |
VSANS (Center of detector) | Converging beam, 6.7 Å, dl/l=12.5% | Rear: 35.6 Mid: 29.6 Front: 5.9 | Rear: 10.2 Mid: 8.5 Front: 2.7 |
Converging beam, medium Q 9 Å, dl/l=12.5% | Mid: 39.8 Front: 8.0 | Mid: 12.2 Front: 2.2 | |
Converging beam, large Q 9 Å, dl/l=12.5% | Mid: 8.0 Front: 2.0 | Mid: 2.2 Front: 0.6 | |
High res, large Q 4.75 Å, dl/l=1% | Mid: 4.8 Front: 1.2 | Mid: 0.1 Front: 0.02 |