iraw
Set or read the output current DAC code.
Usage
>> iraw
0
>> iraw 1000
1000
Notes
Use an unsigned integer DAC code. This command changes the raw current setpoint; prefer iout for calibrated current control when available.
DRV700 compact binary write
DRV700 supports a four-byte binary packet for a direct raw-current update. Reception is disabled at boot. Enable it with rawmode 1 and wait for the response before sending packets:
| Byte | Value |
|---|---|
| 0 | # (0x23) |
| 1 | Code bits 0–7 |
| 2 | Code bits 8–15 |
| 3 | Code bits 16–19; the upper four bits must be zero |
The code range is 0 to 1048575, with the same current direction as the textual write. Send the complete packet in one serial write. There is no terminating newline, echo, prompt, or acknowledgment. Payload bytes are literal: #, carriage return, line feed, backspace, and zero are all permitted within the three-byte value.
For example, code 0x12345 is sent as the bytes 23 45 23 01:
code = 0x12345
if not 0 <= code <= 0xFFFFF:
raise ValueError("DAC code must fit in 20 bits")
serial_port.write(b"#" + code.to_bytes(3, "little"))
This form requires the same write access as iraw. An invalid code does not change the output. Read iraw for the requested code and err for reported faults. Calibrated iout readback is refreshed after each successful update.
Compact packets are serviced frequently, but an operation already in progress can delay an update. There is no guaranteed response time or acknowledgment of physical completion.
Compact reception reserves current control as described in rawmode. Ordinary current writes, dithering, and analog modulation cannot compete with compact packets while it is enabled. A failed transfer disables compact reception and shuts down the current controller. Packets are applied in order; updates are not silently merged or dropped.
Text commands remain available between complete packets. For the lowest latency, wait for the complete text response before resuming compact packets. Packets queued behind a preceding command or response retain their order and can wait for background processing. Consecutive binary packets do not need separators. To disable compact reception, finish the last packet, stop sending binary data, then send rawmode 0 and wait for its response. Enabling or disabling reception does not change the current setpoint. Wait for the disable response before returning current control to other sources.
Compact packets support only unaddressed reception. Do not prepend a board, serial-number, or broadcast address. muxon must permit unaddressed input. Ordinary text commands retain their normal UART multiplexing behavior. Other products do not support this compact form.
Incomplete packets and recovery
A partial compact packet expires if it has not completed within 10 ms after the controller starts processing it. Invalid upper bits, unsupported addressed packets, a packet timeout, a detected receive fault, or an output-transfer failure disable compact reception and stop command reception until four consecutive carriage-return bytes (0D 0D 0D 0D) establish a new boundary. These recovery bytes produce no response. While compact reception is enabled, this rule also applies to receive-buffer overflow and UART line faults during ordinary commands. While disabled, ordinary text recovery is unchanged.
To abort a packet or recover when alignment is uncertain:
- Stop sending commands and discard unsent host output.
- Send a UART break, then allow the controller to process it.
- Send four consecutive carriage returns before sending a fresh command.
- Query
rawmodeand check the response. Compact reception remains disabled; userawmode 1when ready to resume packets.
For a serial connection supporting break signaling:
import time
serial_port.reset_output_buffer()
serial_port.send_break(duration=0.025)
time.sleep(0.02)
serial_port.write(b"\r\r\r\r")
Do not append text commands or recovery bytes directly to an unfinished packet: before the timeout or break is processed, those bytes are still payload. The packet has no checksum; some lost, inserted, or corrupted bytes can form another valid code without being detected. Use it only where this limitation is acceptable. Recovery does not clear recorded errors or confirm an output update.