NXSDataWriter Tango Class User‘s Guide

## NXSDataWriter Tango Python Class

Contents :

- Description
- Properties
- Commands
  - State
  - Status
  - OpenFile
  - OpenEntry
  - Record
  - CloseEntry
  - OpenEntryAsynch
  - RecordAsynch
  - CloseEntryAsynch
  - CloseFile
- Attributes
  - XMLSettings
  - JSONRecord
  - FileName
  - CurrentFileId
  - StepsPerFile
  - CanFail
  - SkipAcquisition
  - Errors
- States

NXSDataWriter Class Identification : | NXSDataWriter Class Inheritance :
Contact | : at desy.de - jan.kotanski
Class Family | : Acquisition
Platform | : All Platforms
Bus | : Not Applicable
Manufacturer | : DESY
Manufacturer ref. | :
| Tango::DeviceImpl NXSDataWriter

NXSDataWriter Class Description :

NXSDataWriter is a Tango server which allows to store NeXuS Data in H5 files.
The server provides storing data from other Tango devices,
various databases as well as passed by a user client via JSON strings.
Source code: https://github.com/nexdatas/nxsdatawriter
Project Web page: https://nexdatas.github.io/nxsdatawriter
NexDaTaS Web page: https://nexdatas.github.io

NXSDataWriter Properties :
There is no class properties

Device Properties
Name | Description | Type | Default Value
NumberOfThreads | maximal number of threads | int | 100
Writer | writer module: `pni` or `h5py` or `h5cpp` | String | none
MetadataOutput | metadata output: `file` | String | none
DefaultCanFail | Default value of CanFail attribute | boolean | True
AddingLogs | Add XML logs in nexus_logs of NXscollection | boolean | True
MaxRecordRuntime | maximal runtime for a record command in seconds | double | 0.0
MaxElementRuntime | maximal runtime for a thread element in seconds | double | 0.0

NXSDataWriter Class Commands
Name | Input type | Output type | Level | Description
State | DEV_VOID | DEV_STATE | OPERATOR | This command gets the device state (stored in its device_state data member) and returns it to the caller.
Status | DEV_VOID | CONST_DEV_STRING | OPERATOR | This command gets the device status (stored in its device_status data member) and returns it to the caller.
OpenFile | DEV_VOID | DEV_VOID | OPERATOR | Opens the H5 file
OpenEntry | DEV_VOID | DEV_VOID | OPERATOR | Creates the new entry
Record | DEV_STRING | DEV_VOID | OPERATOR | Records data for one scan step
CloseEntry | DEV_VOID | DEV_VOID | OPERATOR | Closes the entry
OpenEntryAsynch | DEV_VOID | DEV_VOID | OPERATOR | Creates the new entry in asynchronous mode
RecordAsynch | DEV_STRING | DEV_VOID | OPERATOR | Records data for one scan step in asynchronous mode
CloseEntryAsynch | DEV_VOID | DEV_VOID | OPERATOR | Closes the entry is asynchronous mode
CloseFile | DEV_VOID | DEV_VOID | OPERATOR | Closes the H5 file

Command State :

This command gets the device state (stored in its device_state data member) and returns it to the caller.

State Definition
Input Argument | Tango::DEV_VOID | none
Output Argument | Tango::DEV_STATE | Device state
DisplayLevel | OPERATOR | ..
Inherited | true | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command Status :

This command gets the device status (stored in its device_status data member) and returns it to the caller.

Status Definition
Input Argument | Tango::DEV_VOID | none
Output Argument | Tango::CONST_DEV_STRING | Device status
DisplayLevel | OPERATOR | ..
Inherited | true | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command allowed for | All states | ..

Command OpenFile :

Opens the H5 file

OpenFile Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | OFF EXTRACT RUNNING | ..

Command OpenEntry :

Creates the new entry

OpenEntry Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | ON OFF EXTRACT RUNNING FAULT | ..

Command Record :

Records data for one scan step

Record Definition
Input Argument | Tango::DEV_STRING | JSON string with data
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | ON OFF OPEN RUNNING FAULT | ..

Command CloseEntry :

Closes the entry

CloseEntry Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | ON OFF OPEN RUNNING | ..

Command OpenEntryAsynch :

Creates the new entry in asynchronous mode

OpenEntryAsynch Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | ON OFF EXTRACT RUNNING FAULT | ..

Command RecordAsynch :

Records data for one scan step in asynchronous mode

RecordAsynch Definition
Input Argument | Tango::DEV_STRING | JSON string with data
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | ON OFF OPEN RUNNING FAULT | ..

Command CloseEntryAsynch :

Closes the entry is asynchronous mode

CloseEntryAsynch Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | ON OFF OPEN RUNNING | ..

Command CloseFile :

Closes the H5 file

CloseFile Definition
Input Argument | Tango::DEV_VOID |
Output Argument | Tango::DEV_VOID |
DisplayLevel | OPERATOR | ..
Inherited | false | ..
Abstract | false | ..
Polling Period | Not polled | ..
Command NOT allowed for | ON OFF RUNNING | ..

NXSDataWriter Class Attributes
Name | Inherited | Abstract | Attr. type | R/W type | Data type | Level | Description
XMLSettings | false | false | Scalar | READ_WRITE | Tango::DEV_STRING | EXPERT | An XML string with Nexus configuration.
JSONRecord | false | false | Scalar | READ_WRITE | Tango::DEV_STRING | EXPERT | A JSON string with global client data.
FileName | false | false | Scalar | READ_WRITE | Tango::DEV_STRING | OPERATOR | A name of H5 output file with its full path
CurrentFileId | false | false | Scalar | READ | Tango::DEV_LONG | OPERATOR | Current file id
StepsPerFile | false | false | Scalar | READ_WRITE | Tango::DEV_LONG | OPERATOR | Steps per file
CanFail | false | false | Scalar | READ_WRITE | Tango::DEV_BOOLEAN | OPERATOR | Global can fail flag. By default it is False
SkipAcquisition | false | false | Scalar | READ_WRITE | Tango::DEV_BOOLEAN | OPERATOR | Skip acquisition. It is set to default False value after excuting the OpenEntry, Record or CloseEntry
Errors | false | false | Spectrum | READ | Tango::DEV_STRING | OPERATOR | list of errors

There is no dynamic attribute defined.

Attribute XMLSettings :

An XML string with Nexus configuration.

Attribute Definition
Attribute Type | Scalar
R/W Type | READ_WRITE
Data Type | Tango::DEV_STRING
Display Level | EXPERT
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | Not set
Read NOT allowed for | OFF EXTRACT RUNNING
Write NOT allowed for | OFF EXTRACT RUNNING
Attribute Properties
label | XML Configuration
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute JSONRecord :

A JSON string with global client data.

Attribute Definition
Attribute Type | Scalar
R/W Type | READ_WRITE
Data Type | Tango::DEV_STRING
Display Level | EXPERT
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | Not set
Read NOT allowed for | OFF RUNNING
Write NOT allowed for | OFF RUNNING
Attribute Properties
label | JSON string with client data
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute FileName :

A name of H5 output file with its full path

Attribute Definition
Attribute Type | Scalar
R/W Type | READ_WRITE
Data Type | Tango::DEV_STRING
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | Not set
Read NOT allowed for | OFF EXTRACT OPEN RUNNING
Write NOT allowed for | OFF EXTRACT OPEN RUNNING
Attribute Properties
label | Output file with its path
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute CurrentFileId :

Current file id

Attribute Definition
Attribute Type | Scalar
R/W Type | READ
Data Type | Tango::DEV_LONG
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | Not set
Read NOT allowed for | OFF EXTRACT RUNNING
Attribute Properties
label | Current file id
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute StepsPerFile :

Steps per file

Attribute Definition
Attribute Type | Scalar
R/W Type | READ_WRITE
Data Type | Tango::DEV_LONG
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | true
Write hardware at init. | Not set
Read NOT allowed for | OFF EXTRACT RUNNING
Write NOT allowed for | OFF EXTRACT RUNNING
Attribute Properties
label | Steps per file
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute CanFail :

Global can fail flag. By default it is False

Attribute Definition
Attribute Type | Scalar
R/W Type | READ_WRITE
Data Type | Tango::DEV_BOOLEAN
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | Not set
Read allowed for | All states
Write allowed for | All states
Attribute Properties
label | Can fail
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute SkipAcquisition :

Skip acquisition. It is set to default False value after excuting the OpenEntry, Record or CloseEntry

Attribute Definition
Attribute Type | Scalar
R/W Type | READ_WRITE
Data Type | Tango::DEV_BOOLEAN
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | Not set
Read allowed for | All states
Write allowed for | All states
Attribute Properties
label | Skip acquisition
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

Attribute Errors :

list of errors

Attribute Definition
Attribute Type | Spectrum ( 1000 )
R/W Type | READ
Data Type | Tango::DEV_STRING
Display Level | OPERATOR
Inherited | false
Abstract | false
Polling Period | Not polled
Memorized | Not set
Read allowed for | All states
Attribute Properties
label | list of errors
unit |
standard unit |
display unit |
format |
max_value |
min_value |
max_alarm |
min_alarm |
max_warning |
min_warning |
delta_time |
delta_val |
Attribute Event Criteria
Periodic | Not set
Relative Change | Not set
Absolute Change | Not set
Archive Periodic | Not set
Archive Relative Change | Not set
Archive Absolute Change | Not set
Push Change event by user code | false
Push Archive event by user code | false
Push DataReady event by user code | false

NXSDataWriter Class States
Name | Description
ON | NeXuS Data Server is switch on
OFF | NeXuS Data Writer is switch off
EXTRACT | H5 file is open
OPEN | XML configuration is initialized
RUNNING | NeXus Data Server is writing
FAULT | Error state