outputformat
Usage
>> instrument outputformat [ sn | schedulelabel | datetime | crc | encoding | datatype ]
Security
Open.
Description
Reports or sets properties of the format used to transmit data in real time over any communication link; this format applies to both polled data, and live streamed data if available.
If no arguments are given, all current property settings are reported.
The properties apply to all active schedules; different formats can not be simultaneously active in different situations.
The default format of the output is as follows:
The output starts with a <schedule_label>; all information on this line applies to this schedule only.
Next is a timestamp giving years, months, days, hours, minutes, seconds and thousandths (milliseconds), punctuated as shown in the example below.
Then a value for each channel is sent; this is the measured parameter after conversion to physical units according to the instrument's current calibration.
All values are shown with enough significant digits to ensure no loss of resolution with the datatype currently in force.
All values are shown in 'engineering-notation', which is the same as scientific notation except that the exponents are constrained to be multiples of three.
All elements are separated by a space.
The line terminates with a <CR><LF> pair of characters.
Formally, the default format can be expressed as:
<schedule_label> YYYY-MM-DD hh:mm:ss.ttt <value1> <value2> ... <valueN><CR><LF>
Here is an example of the default format for a 3-channel logger:
sch_fast_CTD 2024-06-10 11:24:14.125 38.6671142e+000 22.0217124e+000 1.95962418e+003<CR><LF>
This default format may be modified by turning some properties on or off. The currently supported parameters are:
sn [= on | off] determines whether or not the output begins with a preamble consisting of the string RBR, followed by a space, then the logger's 6-digit serial number. The default state is off.
schedulelabel [= on | off ] determines whether or not the <schedule_label> appears before the timestamp. The default state is on.
It it s recommended to set schedulelabel=on when multiple schedules are used for a deployment.
datetime [= on | off ] determines whether or not the timestamp appears. The default state is on.
crc [= on | off] determines whether or not a Cyclic Redundancy Check (CRC) is included at the end of the line immediately before the terminating <CR><LF> pair. The default state is off.
The CRC includes all characters already sent on this line, starting with the first, up to and including the last space character before the <CRC>. The calculation uses the 16-bit CCITT polynomial, f(x)=x^16 + x^12 + x^5 + 1, feeding each byte into the generator least significant bit first, and using 0xFFFF as the seed value. The format of the reported CRC is 0xHHHH, where HHHH are four hexadecimal digits; the 0x part of the string is not included in the CRC.encoding [= ascii | binary] determines whether the output is sent in a human-readable ascii form such as that shown in the example above, or a more compact binary format that is more machine-readable for easier parsing.
The binary option is provided only for compatibility with the command set of other instruments. The encoding is always set to ascii, and attempting to change it will provoke an error message. The default setting is ascii.
datatype [= float32 | float64 ] | [= calfloat64 ] is the numeric format used to report data values for all channels.
For normal deployments this will be either float32 (IEEE single precision floating point) or float64 (IEEE double precision floating point), and the end user may specify either option. However, when the instrument's native data type is float32, specifying datatype=float64 will not improve the actual precision of the values; there will just be extra meaningless digits in the output. On the other hand, if the native data type is float64, specifying datatype=float32 will result in fewer bytes being transmitted, which may be useful for sending reduced resolution data over a slow (or expensive) telemetry channel. The instrument's native data type is set at the factory so that it is appropriate for the installed sensors, and can not be changed; see storage datatype. The setting of outputformat datatype should match the native data type when shipped from the factory. Changing outputformat datatype does not affect the resolution of data stored in memory.
For a deployment enabled in calibration mode (see enable storagemode=calibration), the outputformat datatype reported will be calfloat64, regardless of what the instrument's native data type is. This uses IEEE double precision floating point, but reports unprocessed values as a proportion of full scale in the nominal range -1.0 to 1.0. This setting can not be made directly using the outputformat command; it is a result of the options used with the enable command. This setting will persist only as long as such a deployment is active; when the deployment finishes, the setting reported will revert to either float32 or float64, whichever was in force prior to the calibration deployment.
All properties may be set independently from one another; they may be used singly or in combinations. Refer to the examples below for usage and the impact on the streamed data output.
Examples
>> instrument outputformat
<< instrument outputformat sn=off schedulelabel=on datetime=on crc=off encoding=ascii datatype=float32
These are the default settings that produce the default format.
>> instrument outputformat schedulelabel=off
<< instrument outputformat schedulelabel=off
Remove from the default format the schedule label, to simplify the output when only one schedule is used:
Format:
YYYY-MM-DD hh:mm:ss.ttt <value1> <value2> ... <valueN><CR><LF>
Three-channel logger example:
2024-06-10 11:24:14.125 38.6671142e+000 22.0217124e+000 1.95962418e+003<CR><LF>
>> instrument outputformat sn=on
<< instrument outputformat sn=on
Add to the default format the preamble that includes the serial number:
Format:
RBR <serial_number> <schedule_label> YYYY-MM-DD hh:mm:ss.ttt <value1> <value2> ... <valueN><CR><LF>
Three-channel logger example:
RBR 142152 sch_fast_CTD 2024-06-10 11:24:14.125 38.6671142e+000 22.0217124e+000 1.95962418e+003<CR><LF>
>> instrument outputformat crc=on
<< instrument outputformat crc=on
Add to the default format the CRC, for applications where high confidence in output correctness is required:
Format:
<schedule_label> YYYY-MM-DD hh:mm:ss.ttt <value1> <value2> ... <valueN> <CRC><CR><LF>
Three-channel logger example:
sch_fast_CTD 2024-06-10 11:24:14.125 38.6671142e+000 22.0217124e+000 1.95962418e+003 0xB9D8<CR><LF>