|
Alicat BASIS-2 Driver 1.0.0
API reference
|
Namespaces | |
| namespace | MeasurementTrigger |
| Measurement-trigger bitmask — register 4200 (controllers only). | |
| namespace | modbus |
| namespace | reg |
Classes | |
| class | Driver |
| Main BASIS-2 driver. More... | |
| struct | DriverResult |
Lightweight result wrapper. Aborts on value() if !ok(). More... | |
| struct | DriverResult< void > |
| struct | InstantaneousData |
| Decoded snapshot of registers 2100..2109 (one Modbus burst). More... | |
| struct | InstrumentIdentity |
| Static identification of an instrument (read once at init). More... | |
| struct | InstrumentStatus |
Carries the global instrument health derived from InstantaneousData. More... | |
| struct | MeasurementData |
| Decoded measurement-window result (registers 4201..4215). More... | |
| class | UartInterface |
| CRTP base for the BASIS-2 serial transport. More... | |
Enumerations | |
| enum class | DriverError : uint8_t { None = 0 , NotInitialized , InvalidParameter , InvalidAddress , BufferTooSmall , SerialError , Timeout , BadCrc , InvalidFrame , ModbusException , UnsupportedRequest , ResponseMismatch , AsciiBadResponse } |
| Driver-level error codes. More... | |
| enum class | ModbusExceptionCode : uint8_t { None = 0x00 , IllegalFunction = 0x01 , IllegalDataAddress = 0x02 , IllegalDataValue = 0x03 , ServerDeviceFailure = 0x04 , Acknowledge = 0x05 , ServerDeviceBusy = 0x06 } |
| Exception code of a Modbus exception reply (function code | 0x80, one code byte). More... | |
| enum class | Gas : uint8_t { Air = 0 , Argon = 1 , CarbonDioxide = 2 , Nitrogen = 3 , Oxygen = 4 , NitrousOxide = 5 , Hydrogen = 6 , Helium = 7 , Methane = 8 } |
| Index into the BASIS-2 calibrated gas table. More... | |
| enum class | FlowUnits : uint8_t { SCCM = 0 , NCCM = 1 , SLPM = 2 , NLPM = 3 , SmL_s = 4 , NmL_s = 5 , SmL_m = 6 , NmL_m = 7 , SL_h = 8 , NL_h = 9 , SCCS = 10 , NCCS = 11 , Sm3_h = 12 , Nm3_h = 13 , Sm3_d = 14 , Nm3_d = 15 , SCIM = 16 , SCFM = 17 , SCFH = 18 , SCFD = 19 , Unknown = 0xFF } |
| Flow-unit identifier read from instrument register 49. More... | |
| enum class | BaudRate : uint8_t { Bps_4800 = 0 , Bps_9600 = 1 , Bps_19200 = 2 , Bps_38400 = 3 , Bps_57600 = 4 , Bps_115200 = 5 } |
| Baud-rate codes for register 21 (datasheet "Changing the Baud Rate"). More... | |
| enum class | SetpointSource : uint8_t { Analog = 0 , DigitalSaved = 1 , DigitalUnsaved = 2 } |
| Setpoint source — register 516 (controllers only). More... | |
| enum class | TotalizerLimitMode : uint8_t { SaturateNoError = 0 , ResetNoError = 1 , SaturateWithOvr = 2 , ResetWithOvr = 3 } |
| Totalizer overflow behaviour — register 54. More... | |
Functions | |
| const char * | GetDriverVersion () noexcept |
| Driver version string (from generated alicat_basis2_version.h). | |
| constexpr std::string_view | ToString (DriverError e) noexcept |
| Convert a DriverError to a stable human-readable string (no allocation). | |
| constexpr std::string_view | ToString (ModbusExceptionCode c) noexcept |
| Convert a ModbusExceptionCode to a stable human-readable string (no allocation). | |
| constexpr std::string_view | GasShortName (Gas g) noexcept |
| constexpr std::string_view | ToString (FlowUnits u) noexcept |
| constexpr uint32_t | BaudRateToBps (BaudRate b) noexcept |
Variables | |
| constexpr uint8_t | kBroadcastAddress = 0 |
| constexpr uint8_t | kMaxModbusAddress = 247 |
| constexpr uint16_t | kMagicTare = 0xAA55 |
| constexpr uint16_t | kMagicFactoryRestore = 0x5214 |
| constexpr uint16_t | kDefaultTimeoutMs = 200 |
| constexpr uint16_t | kInterFrameDelayMs = 5 |
| constexpr uint32_t | kDefaultBusBaudBps = 38400 |
| Baud rate the driver assumes for the inter-frame gap until told otherwise (the instrument's factory default, manual Rev 4 p. | |
|
strong |
Baud-rate codes for register 21 (datasheet "Changing the Baud Rate").
The numeric value is what the instrument expects on the wire; the BaudRateToBps helper converts it to a real bits-per-second number for driver-side serial-port reconfiguration.
| Enumerator | |
|---|---|
| Bps_4800 | |
| Bps_9600 | |
| Bps_19200 | |
| Bps_38400 | Factory default. |
| Bps_57600 | |
| Bps_115200 | |
|
strong |
Driver-level error codes.
Every public Driver entry point returns one of these in its result type. The values are stable and may be used directly in CAN/MQTT payloads.
| Enumerator | |
|---|---|
| None | Operation succeeded. |
| NotInitialized | Driver not initialized yet. |
| InvalidParameter | Out-of-range argument. |
| InvalidAddress | Modbus address outside 1..247. |
| BufferTooSmall | Provided buffer is too small for the response. |
| SerialError | Serial transport-layer error (HW failure). |
| Timeout | No response within the configured timeout. |
| BadCrc | CRC-16 mismatch on received Modbus frame. |
| InvalidFrame | Frame too short, wrong function code, etc. |
| ModbusException | Slave returned a Modbus exception PDU. |
| UnsupportedRequest | Slave does not implement this register/command. |
| ResponseMismatch | Echo doesn't match request (function 6/16). |
| AsciiBadResponse | ASCII reply not parseable. |
|
strong |
|
strong |
|
strong |
Exception code of a Modbus exception reply (function code | 0x80, one code byte).
Modbus Application Protocol V1.1b3, section 7. The BASIS-2 manual (Rev 4, "Communicating Via
Modbus-RTU", p. 18) names the illegal data address ("Bad Address") reply for undefined registers. Driver::GetLastException() returns the code of the last exception reply.
|
strong |
Setpoint source — register 516 (controllers only).
Analog — 0–5 V or 4–20 mA on pin 1 controls the setpoint; digital S / register-2053 writes are ignored. DigitalSaved — most recent digital setpoint is persisted to flash and used at next power-up. Avoid frequent writes (the datasheet warns of NVM wear). DigitalUnsaved — digital setpoint is volatile (lost on power loss). Recommended whenever the setpoint changes faster than once per few minutes.
| Enumerator | |
|---|---|
| Analog | |
| DigitalSaved | |
| DigitalUnsaved | |
|
strong |
|
constexprnoexcept |
|
constexprnoexcept |
|
inlinenoexcept |
Driver version string (from generated alicat_basis2_version.h).
|
constexprnoexcept |
Convert a DriverError to a stable human-readable string (no allocation).
|
constexprnoexcept |
|
constexprnoexcept |
Convert a ModbusExceptionCode to a stable human-readable string (no allocation).
|
inlineconstexpr |
|
inlineconstexpr |
Baud rate the driver assumes for the inter-frame gap until told otherwise (the instrument's factory default, manual Rev 4 p.
18).
|
inlineconstexpr |
|
inlineconstexpr |
modbus::InterFrameGapUs(), Driver::SetBusBaudRate().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |