studio-seventeen
WORKSHOP--:--
~/workshop/skills/modbus/check-byte-order.md

$check-byte-order

SKILL 13 / 20READ-ONLYHUMAN APPROVALNOT FOR BIT ORDER

Determine byte order without another device read.

Give the skill the raw words from one read. For a value that uses two or more registers, it calculates every supported byte and word order. For a one-register integer, it confirms that word order does not apply.

ONE PHYSICAL READ

One sample, all supported orders

0x42F60xE979

The sample includes the register and time of the read. The evaluation does not send another Modbus request.

ABCDUse the bytes in the order shownpossible result
BADCReverse the bytes in each wordpossible result
CDABReverse the two 16-bit wordspossible result
DCBAReverse the words and their bytespossible result

WHEN TO USE IT

Use it when the map does not define byte order

For a multi-register value, run one safe read and compare the calculated values with the equipment value. A one-register integer uses the Modbus protocol byte order and has no word order.

  1. 01read the saved sample
  2. 02calculate each supported layout
  3. 03confirm the matching layouthuman approval
  4. 04add it to the map

YOUR APPROVALDo not add a byte order to the final map until you compare the calculated value with the known equipment value.

STOPCoil or packed-bit numbering is a map hold for $check-map. Resolve it through map review with an explicit bit-numbering rule. It is not an ABCD, BADC, CDAB, or DCBA question.

BEFORE YOU START

Give the skill these details

  • The device, unit, register area, and protocol offset
  • One raw word for a 16-bit integer, two for 32-bit data, or four for 64-bit data
  • The register that produced the words and the time of the read
  • The expected value or known equipment condition, when available

A GOOD RESULT

You can explain the byte and word order

  • The skill checks that the sample width matches the data type
  • Every supported order is shown for a multi-register value
  • A one-register integer is not given a false word order
  • The final map shows the order that you selected

EXAMPLE REQUEST

Give the agent the raw words and what you know about the point.

Use this example as a starting point. Replace the register and sample values with your own.

CODEX$check-byte-order
CLAUDE CODE/modbus-skills:check-byte-order
CURSOR + OTHER CLIENTSUse the client’s native skill invocation.
$check-byte-order

These raw words came from holding registers 120 and 121: `0x42F6 0xE979`. Show me the value for every supported byte and word order. I will confirm which result matches the equipment.
GitHub source ↗