PyRogue Devices and Variables Recipes

Use these recipe-oriented pages for concrete examples:

Recipe 1: Add A Memory-Backed Control Variable

Problem

Expose a hardware register field as a writable tree variable.

Procedure

  1. Define a RemoteVariable in your device.

  2. Attach correct bit offset/size and access mode.

  3. Validate read/write behavior from a simple client.

Deep Dive

Recipe 2: Create A Computed Status Value

Problem

Expose a derived metric without adding new hardware registers.

Procedure

  1. Define a LinkVariable that depends on one or more source variables.

  2. Keep computation deterministic and side-effect free.

  3. Confirm update behavior during polling and command workflows.

Deep Dive