Skip to content

Response

This section will cover the possible responses the Ravas RedBox will sent after a request has been processed

Overview

The payload type is used to check the type of Response field which is sent by the Ravas RedBox. The table below shows the common Response fields:

Response field Description
result See RavasCode
parameter A parameter result. See ParameterDescription
log A string with log information from the Ravas RedBox
Raw_ADC raw ADC counts
Raw_IMU raw IMU values of all axis
analog_diagnostics See AnalogDiagnosticsResult
alibi_entry See alibi_entry
wim_result See alibi_entry
weight_ext See WeighingResult_ext
power_event See 'PowerEvent'
printer_event See 'PrinterEvent'

Response fields

Parameters

Within the parameter response type the ParameterDescription is included. This description contains information about the parameter.

- Parameter description

The parameter description contains a set of information. Within this set of information the ParameterFlags and ParameterValue fields are included, as well as the following data:

Field Type Description
Page_id PageID
Parameter_ID uint32
human_readable_name string
Flags ParameterFlags
Value ParameterValue

- Parameter flags

Within the flag field each bit relates to a specific flag. The next table gives an overview of the corresponding flags.

Field Value Description
FLAGS_NONE 0x00 No flags are set
READ_ONLY 0x01 (Bit 0) Read only
SAVED_TO_FLASH 0x02 (Bit 1) Saved to flash (retention)
LEGALLY_RELEVANT 0x04 (Bit 2) Legally relevant. Cannot be modified if the system is sealed for legal for treade.
IS_CALIBRATION 0x08 (Bit 3) Contains calibration data of the scale
WEIGHT_UNIT_TRANSLATED 0x10 (Bit 4) Automatically converted if the `WeightUnit' is changed
USER_LEVEL_BITMASK 0x1C0 (Bit 6,7,8) User-level required for writing

- Parameter value

The parameterValue contains one of the following types:

Field Type Description
s32_array Sint32Array Array of int32 values.
u32_array Uint32Array Array of uint32 values.
f32_array Float32Array Array of float32 values.
String ASCII text
Sint32 int32
Uint32 uint32
Float32 float
Bool bool
Uint64 uint64
referenced_page_id PageID

Analog diagnostics

This section will cover the analog diagnostic field. The main purpose of this response is to indicate whether the connected loadcells are functioning as expected.

- Analog diagnostics result

The analog diagnostics result response consists of two fields. The LoadcellDiagnostic part of the response will be included the same amount of times as there are loadcells in the system.

For example, the response has three LoadcellDiagnostic fields when the system contains three loadcells.

Field Type Description
reference_detected Bool Reserved for future use
loadcell_diagnostic LoadcellDiagnostic Repeated for each detected loadcell

- Loadcell diagnostic

The Loadcell diagnostic field contains the diagnostic information of an individually connected loadcell.

Field Type Description
connection_status LoadcellStatus Contains the status of the loadcell
resistance_estimation Uint32 Rough estimation of resistance in ohms between SIG+ and SIG-, +- 20%
adc_counts Int32 ADC counts measured with a positive excitation voltage
adc_counts_4uA Int32 Measured with a positive excitation voltage (3V3) and while supplying 4 uA current through SIG+ and SIG-
corner Scale_Parameter If known, which corner this loadcell is assigned to (Scale_Parameter_CORNER_A,B,C,D)
scale PageID Which scale this corner is assigned to (PageID_SCALE_1,2,3,4).

- Loadcell status

The loadcell status field contains an enum of the status of an individually connected loadcell.

Field Description
UNKNOWN Diagnostic action not performed
ERROR_FLOATING Loadcell is not detected (resistance > 2 kΩ)
ERROR_SHORT Loadcell is shorted (resistance < 200Ω)
DETECTED_OK Loadcell detected OK

Alibi

The Alibi response contains an alibi result for legal for trade weighing results.

- Alibi entry

Field Type Description
status RavasCode Check for validity of alibi entry
id Uint32 Unique Alibi ID
scale_index Uint32 Scale ID
Unit WeightUnit
Gross Float Stored gross weight
Net Float Stored net weight
Tare Float Stored tare weight
Num_decimals uint32 Number of digits after the decimal separator. When converting weight values to text, this value must be used to limit the number of digits shown
timestamp RtcTime deprecated
utc_unix_time uint64 Timestamp when the alibi is created
Type Alibi_Type
number_of_weighings uint32 In case of type: TOTAL_FINAL
duration_ms Uint32 Duration that the measurement took, for WiM only. Otherwise set to 0

- Alibi type

This enumeration contains the alibi type of a specific alibi entry.

Field Description
GENERIC Reserved for future use
WEIGH_IN_MOTION Weigh in Motion related alibi entry
TOTAL_FINAL Final totalizing alibi
TOTAL_ONGOING intermediate totalizing state

Weighing result extended

This is the primary way the RedBox reports its live weight information.

Note

Please take care to apply the specified rounding when converting from floating point to a string using the significant_digits field. For example: printf("%.*f", (int)weight.significant_digits, weight.net);

Field Type Description
mode Weighing_Mode Static or in motion
scale_number uint32 Scale number index
unit WeightUnit Weights are presented in kilogram or pounds
net float Net weight, if no tare active this is the same weight as gross
gross float Gross weight
tare float Tare weight
single_measurement_progress float When in motion mode: percentage of progress of calculation
significant_digits uint32 Must be used when displaying the weight.
weight_can_be_shown bool Weight is valid and can be shown on the screen (No error)
weight_can_be_used_stored_transmitted bool Weight is valid to store on another device
in_zero_range bool Weight is within zero range
stable bool Weight is stable
safety_critical_error bool There is a safety criticial error (Overload)
scale_interval float Scale interval being used (e)
status RavasCode Status of the weight. Normally RavasCode_OK, otherwise the error is specified in this field
scale_interval_index uint32 Scale interval index array
alibi_nr uint32 Unique weighing alibi number
total_update TotalizingResult Field with the totalizing status register
x_angle float Current x angle of the weighing platform
y_angle float Current y angle of the weighing platform

Power Event

The power event field describes any possible events that concern the power of the connected RedBox device.

Field Description
POWER_NORMAL
POWER_LIGHT_SLEEP Event sent when timer has elapsed. When all clients are disconnected the scale goes into sleep mode
POWER_DEEP_SLEEP Not used at this moment
POWER_BATTERY_LOW Signal to indicate that the battery is low and should be charged

Printer Event

The printer event field describes any printer related events.

Field Description
PRINTER_REQUEST_CONNECT Reserved for future use
PRINTER_CONNECTION_FAILED Reserved for future use
PRINTER_CONNECTION_OK Reserved for future use
PRINTER_PRINT_OK Reserved for future use
PRINTER_PRINT_BUSY Reserved for future use

Totalising Result

The totalising result field provides information when the scale has a totalised weighing measurement.

Field Type Description
finalized bool The totalising action is finalised
need_to_see_zero bool Scale need to go to gross zero before you can totalise the next weight
biggest_scale_interval_index uint32 Index of the biggest scale interval
number_of_weighings uint32 Number of weighings in the register
total_net float Current total net weight
total_gross float Current total gross weight

Enums

- System preset

Field Description
NOT_CONFIGURED No standard configuration
ICP_STATIC_1LC Configured for ICP with 1 loadcell
ICP_STATIC_2LC Configured for ICP with 2 loadcells
ICP_WIM_1LC Configured for WIM ICP with 1 loadcell
ICP_WIM_2LC Configured for ICP with 2 loadcells
IFORKS_STATIC_4LC Configured for Iforks with 4 loadcells
IFORKS_STATIC_6LC Configured for Iforks with 6 loadcells
PALLET_JACK_STATIC_4LC Configured for a pallet jack with 4 loadcells
PALLET_JACK_STATIC_6LC Configured for a pallet jack with 6 loadcells

- BLE Mode

Field Description
BLE_DISABLED BLE adapter disabled
BLE_PERIPHERAL Default
BLE_IFORKS_MASTER Reserved for future use
BLE_IFORKS_SLAVE Reserved for future use

- WiFi Mode

Field Description
WIFI_DISABLED Wifi adapter disabled
WIFI_SOFTAP Soft AP: connect to station: if failed create acces-point (default)
WIFI_STATION Only connect to WiFI station

- WiFi Authentication Mode

Field Description
WIFI_AUTH_OPEN No encryption
WIFI_AUTH_WEP WEP encryption
WIFI_AUTH_WPA_PSK WPA-PSK encryption
WIFI_AUTH_WPA2_PSK WPA2-PSK encryption
WIFI_AUTH_WPA_WPA2_PSK
WIFI_AUTH_WPA2_ENTERPRISE WPA2 enterprise encryption
WIFI_AUTH_WPA3_PSK WPA3 PSK encryption
WIFI_AUTH_WPA2_WPA3_PSK
WIFI_AUTH_WAPI_PSK WAPI PSK encryption
WIFI_AUTH_OWE OWE encryption

- Weighing Mode

Field Description
STATIC Static mode (default)
IN_MOTION In motion measurement

- Weight Unit

Field Description
kg Weights are converted to kilogram (kg)
lb Weights are converted to pounds (lb)
Field Description
DISABLED No legal for trade
OIML OMIL regulation
NTEP NTEP regulation

- RS232 protocol

Field Description
RS232_DISABLED No protocol selected
RS232_ASCII_PC Legacy ASCII protocol
RS232_REDBOX Ravas RedBox protocol
RS232_DISPLAY3200 Ravas 3200 display protocol
RS232_CLINOMITE Legacy ClinoMite protocol

- RS485 protocol

Field Description
RS485_DISABLED No protocol selected
RS485_FEMLINK_SLAVE FEMLink protocol
RS485_FEMLINK_MASTER FEMLink protocol