Response
This section will cover the possible responses the Ravas RedBox will sent after a request has been processed.
Overview
A Response carries the message_id of the request it answers, plus exactly one payload field. Check which payload field is set to know what you received — in C# that is response.PayloadCase, in nanopb response.which_payload. The table below shows the Response fields:
| Response field | Description |
|---|---|
result |
The plain answer to a command: OK, or why it was refused. See RavasCode |
parameter |
One parameter's name, flags and value. See ParameterDescription |
weight_ext |
A weight reading. See WeighingResult_ext |
alibi_entry |
One record read out of the alibi memory. See AlibiEntry |
wim_result |
A completed weigh-in-motion measurement, sent to SUBSCRIBE_WEIGHT subscribers. Same AlibiEntry message, but a separate field so the client knows it is a brand new measurement |
power_event |
The device went to sleep, woke up, or is low on battery. See PowerEvent |
printer_event |
The printer connected, failed, or finished a print job. See PrinterEvent |
scan_result |
One network found by a WiFi scan. See WifiAPRecord |
scan_done |
The WiFi scan has finished, so the results are ready for GET_WIFI_APS. Sent to SUBSCRIBE_PARAMETERS subscribers |
ota_progress |
Progress of a firmware update, 0.0 to 1.0. Only appears while RAVAS service tooling is updating the device |
Warning
Responses are not only answers. Once you subscribe, the RedBox sends weight_ext, power_event and printer_event messages on its own. Use message_id to pair a response with the request that caused it.
Weighing result
WeighingResult_ext is the primary way the RedBox reports its weight information. You receive it as the live feed after SUBSCRIBE_WEIGHT, and as the answer to GET_STATIC_WEIGHT_WITH_ALIBI and SET_SUM_FINAL.
Fields
| Field | Type | Description |
|---|---|---|
| mode | Weighing_Mode |
Static, static-automatic 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 is active this is the same weight as gross |
| gross | float | Gross weight |
| tare | float | Tare weight, as a negative number |
| single_measurement_progress | float | Weigh-in-motion progress of the calculation, 0.0 to 1.0 |
| significant_digits | uint32 | Number of digits after the decimal point. Must be used when displaying the weight |
| weight_can_be_shown | bool | See Validity flags |
| weight_can_be_used_stored_transmitted | bool | See Validity flags |
| in_zero_range | bool | Weight is within zero range |
| stable | bool | Weight is stable |
| safety_critical_error | bool | See Validity flags |
| scale_interval | float | Scale interval being used (e) |
| scale_interval_inv | float | 1 / scale_interval, provided so you do not have to divide |
| status | RavasCode |
Why the flags above are false. OK when nothing is wrong |
| scale_interval_index | uint32 | Index into the scale interval array, for a multirange scale |
| alibi_nr | uint32 | Unique weighing alibi number, set when this reading was stored in the alibi memory |
| total_update | TotalizingResult |
The totalizing register. Not filled in in the answer to SET_SUM_FINAL |
| x_angle | float | Current x angle of the weighing platform in degrees |
| y_angle | float | Current y angle of the weighing platform in degrees |
| x_loadcenter | float | Position of the centre of the load on the x axis |
| y_loadcenter | float | Position of the centre of the load on the y axis |
| misc_io | uint32 | Bitfield with the state of the general purpose inputs |
Validity flags
The weight fields always carry a number, also when that number must not be used. Three booleans decide what you may do with net, gross and tare in this message, and status says why. Check them on every message — they change from one reading to the next.
| Flag | When false |
|---|---|
weight_can_be_shown |
Put no weight on screen at all. Show the reason from status instead |
weight_can_be_used_stored_transmitted |
The weight may be shown to the operator, but must not be stored, printed, forwarded to another system or used in a transaction |
weight_can_be_shown is false when the scale is in error or still warming up, overloaded or underloaded, tilted past its limit, or when the load sits too far off centre.
weight_can_be_used_stored_transmitted is false whenever status is not OK, and also while the reading is still moving or is negative.
Warning
A weight you may show is not automatically a weight you may keep. The two flags are separate on purpose and have to be evaluated separately.
safety_critical_error is the third flag and works the other way round: true means the reading was withheld because of a dangerous condition — an overload, or the load tipping off the forks. Warn the operator; this is not an ordinary "no weight yet".
Where these rules come from
- Withholding the indication on a fault condition: NIST HB44 2.20 S.1.14.1.
- Indication ceilings on overload: OIML R76-1 4.2.3, OIML R51-1, HB44 2.20 S.1.7(a).
- The show/store split for negative values: OIML R76-1 4.2.3 allows negative values down to −20 d to be displayed, provided they are never transmitted, printed or used. OIML R51 grants no negative-indication allowance at all.
- Minimum capacity of 20 e: OIML R76-1 3.2. Nothing recorded on a fault: HB44 2.20 S.1.14.1.
The load-tipping check is a RAVAS safety check rather than a metrological one.
Displaying the weight
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);
significant_digits is not cosmetic: showing more digits than the scale resolves misrepresents the instrument's resolution, and is not allowed under legal for trade.
A minimal, correct display routine therefore looks like this:
Example
void show_weight(const WeighingResult_ext *w)
{
if (w->safety_critical_error) {
display_warning(w->status); // Overload or tipping load: warn the operator
return;
}
if (!w->weight_can_be_shown) {
display_status(w->status); // e.g. warming up, tilted, off centre
return;
}
printf("%.*f %s%s", (int)w->significant_digits, w->net,
w->unit == WeightUnit_kg ? "kg" : "lb",
w->stable ? "" : " ~");
}
Store or transmit the value only when weight_can_be_used_stored_transmitted is true — and when the reading has to end up in the alibi record, use GET_STATIC_WEIGHT_WITH_ALIBI instead of copying a value out of the live feed.
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 |
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 |
Which parameter page this parameter belongs to |
| parameter_id | uint32 | Parameter number within that page |
| human_readable_name | string | Empty when you subscribed with "skip names", and in the updates after the first full pass |
| flags | Parameter_Flags |
Bitfield |
| value | ParameterValue |
The value itself |
- 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_array | StringArray | Array of strings. |
| String | string | ASCII text |
| Sint32 | int32 | |
| Uint32 | uint32 | |
| Float32 | float | |
| Bool | bool | |
| Uint64 | uint64 | |
| referenced_page_id | PageID |
Alibi
The Alibi response contains an alibi result for legal for trade weighing results. The alibi memory is the instrument's store of measurement data in the sense of WELMEC Guide 7.2, Extension L.
- 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 |
Kilogram or pounds |
| gross | Float | Stored gross weight |
| net | Float | Stored net weight |
| tare | Float | Stored tare weight. Negative for a tare taken with SET_TARE, positive for a manual or preset tare |
| 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, use utc_unix_time |
| utc_unix_time | uint64 | Timestamp when the alibi is created, in seconds since 1970 |
| type | Alibi_Type |
What kind of weighing this record holds |
| 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 |
WiFi scan result
One scan_result response is sent per network found, after a GET_WIFI_APS request.
| Field | Type | Description |
|---|---|---|
| ssid | string | Network name |
| mac | bytes | BSSID of the access point |
| rssi | int32 | Signal strength in dBm |
| channel | uint32 | WiFi channel |
| auth_mode | Wifi_AuthMode |
Encryption used by the network |
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 |
Enums
- System preset
Value of the system parameter PRESET, indicating the standard configuration the device was set up with.
| 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 |
- Display 3200 state
Value of the BLE parameter DISPLAY_3200_STATE.
| Field | Description |
|---|---|
| DISCONNECTED | No 3200 display connected |
| SCANNING | Looking for the configured display |
| BONDING | Pairing in progress |
| CONNECTED | Display connected |
- 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 |
| WIFI_AUTH_MAX | Marks the end of the list |
- WiFi connect state
Value of the WiFi parameter STA_CONNECT_STATE: the result of the last attempt to join a network. Clear it with the WIFI_CLEAR_MESSAGE request.
| Field | Description |
|---|---|
| SUCCESS | Connected |
| NO_AP_FOUND | The configured network was not seen |
| NO_AP_FOUND_W_COMPATIBLE_SECURITY, NO_AP_FOUND_IN_AUTHMODE_THRESHOLD, NO_AP_FOUND_IN_RSSI_THRESHOLD | Network seen, but rejected on security or signal strength |
| AUTH_FAIL, ERR_802_1X_AUTH_FAILED, AUTH_EXPIRE, HANDSHAKE_TIMEOUT | Wrong password or authentication refused |
| ASSOC_FAIL, ASSOC_NOT_AUTHED, TRANSMISSION_LINK_ESTABLISH_FAILED, TIMEOUT, BEACON_TIMEOUT | The connection could not be established |
| AUTH_LEAVE, ASSOC_LEAVE, STA_LEAVING, PEER_INITIATED, AP_INITIATED, ROAMING | The connection was dropped afterwards |
| GROUP_KEY_UPDATE_TIMEOUT, GROUP_CIPHER_INVALID, PAIRWISE_CIPHER_INVALID, NOT_AUTHORIZED_THIS_LOCATION, NOT_ENOUGH_BANDWIDTH, UNSPECIFIED | Other reasons reported by the WiFi stack |
- Weighing Mode
| Field | Description |
|---|---|
| STATIC | Static mode (default) |
| IN_MOTION | In motion measurement |
| STATIC_AUTOMATIC | Static measurement, started automatically by the scale |
- Weight Unit
| Field | Description |
|---|---|
| kg | Weights are converted to kilogram (kg) |
| lb | Weights are converted to pounds (lb) |
- Legal for trade Mode
| Field | Description |
|---|---|
| DISABLED | No legal for trade |
| OIML | OIML regulation |
| NTEP | NTEP regulation |
| MEASUREMENT_CANADA | Measurement Canada |
- Loadcell status
Value of the loadcell parameter STATUS.
| Field | Description |
|---|---|
| UNKNOWN | Diagnostic action not performed |
| ERROR_FLOATING | Loadcell is not detected (resistance > 3 kΩ) |
| ERROR_SHORT | Loadcell is shorted (resistance < 100 Ω) |
| DETECTED_OK | Loadcell detected OK |
| PENDING_CONNECTION | Detection still in progress |
| REDBOX_UNAVAILABLE | The loadcell is on an external RedBox that is unbound, has sent nothing for 10 s, or refused this master |
- 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 |
| RS232_HYDRAULIC_WEIGHING_IO | Hydraulic weighing I/O interface |
- RS485 protocol
| Field | Description |
|---|---|
| RS485_DISABLED | No protocol selected |
| RS485_RAVAS_LINK | RAVAS Link protocol |
| RS485_ASCII_PC | Legacy ASCII protocol |
| RS485_REDBOX | Ravas RedBox protocol |