device_protocols

Borui / “power” device protocol

This document describes the low-level serial protocol implemented by the Borui-style programmable regulated power supply. It is written for developers who need to talk directly to the instrument (implement a client, driver or test harness).

Summary (quick reference)

Physical/serial parameters

Framing and I/O semantics

Inter-frame timing

Message structure

Typical device messages use the following fixed layout (decimal digits):

<op(2)><payload(5)><param(4)>

The exact semantics of op, payload and param depend on the command; the device uses different opcodes for measurement vs. control frames.

Numeric encoding and scaling

Encoding details (common conventions)

Because the device does not explicitly indicate the payload scale in every response, drivers should consult the instrument’s manual for exact scaling per-opcode, or infer scale from expected ranges and precision.

Examples:

Command/response behavior

Opcode summary (common opcodes)

The two-digit op field identifies the request or response type. Observed conventions:

Note: response opcodes are typically the request opcode plus 10 (decimal). Implementations should accept these observed mappings but consult the device manual for complete opcode tables.

Testing-derived specifics

Timing and robustness

Example frames

<02012200000>   # Example: read voltage request
<02012345000>

In the reply above, op = 02, payload = 01234, param = 5000 (field meanings depend on opcode); if payload uses centi-units, 01234 → 12.34 units.

CV/CC state and parameter field

Hex representation (wire bytes)

Implementation recommendations

Summary

This instrument uses short bracketed ASCII frames with fixed digit fields: 2-digit opcode, 5-digit numeric payload and a 4-digit parameter/status block. Numeric payloads are fixed-point integers (implied decimal) and scaling varies by measurement type; use the vendor examples above and the device manual to choose the correct scaling per-opcode.

Error handling and best practices

Implementation checklist for a driver