API reference
MockSOLO.MockSOLO — Module
Mock of a Sutter SOLO-50 single-axis micromanipulator served on a virtual serial port. See MockSOLO.start.
Lifecycle
MockSOLO.start — Function
MockSOLO.start(; timescale = 1.0) -> MockSOLO50Open a pty, serve the SOLO-50 serial protocol on it and return the handle. Point host software at portname(dev). timescale speeds moves up (Inf = instant).
MockSOLO.stop — Function
stop(m)Close the port and end the server. Returns promptly even mid-move; calling it again is a no-op. Rethrows if a server task failed.
MockSOLO.MockSOLO50 — Type
Handle to a running mock SOLO-50. Create with MockSOLO.start; point host software at portname(m).
MockSOLO.portname — Function
portname(dev) -> StringPath of the virtual serial port, e.g. "/dev/ttys004". Give this to the host software. Readable after stop.
MockSOLO.open_port — Function
open_port(path) -> IOOpen the host side of the pty at path as a non-blocking stream. Use this to talk to the mock from the same Julia process: blocking I/O (open, IOStream, ccall reads) starves the mock's tasks and hangs.
Inspection
MockSOLO.position_usteps — Function
position_usteps(dev) -> UInt32Current position in µsteps (0.09375 µm each), interpolated live while a move runs.
MockSOLO.screen — Function
screen(dev) -> (absolute_um, relative_um, color)What the controller's screen shows: absolute and relative position in whole µm and the color, which is :red during a move (running or paused), otherwise :blue in relative mode or :green.
MockSOLO.traffic — Function
traffic(dev) -> Vector{@NamedTuple{t::Float64, dir::Symbol, bytes::Vector{UInt8}}}Copy of the traffic log. t is seconds since start and dir is :in (host → mock) or :out (mock → host). There is one entry per read chunk and one per reply. Readable after stop.
Front panel
MockSOLO.press_home! — Function
press_home!(dev)Press HOME. When idle, start moving to the stored home position. During a HOME move, toggle pause/resume. Ignored during any other move.
MockSOLO.hold_home! — Function
hold_home!(dev)Hold HOME: store the current position as home. Ignored during a move.
MockSOLO.press_work! — Function
press_work!(dev)Press WORK. When idle, start moving to the stored work position. During a WORK move, toggle pause/resume. Ignored during any other move.
MockSOLO.hold_work! — Function
hold_work!(dev)Hold WORK: store the current position as work. Ignored during a move.
MockSOLO.pulse! — Function
pulse!(dev)Press PULSE: move +30 µsteps (2.8125 µm), clamped to the end of travel. Ignored during a move.
MockSOLO.press_relative! — Function
press_relative!(dev)Press RELATIVE: toggle the screen between absolute (green) and relative (blue) mode. Display only; serial coordinates stay absolute. Ignored during a move.
MockSOLO.hold_relative! — Function
hold_relative!(dev)Hold RELATIVE: zero the relative display at the current position. Ignored during a move.
MockSOLO.press_speed! — Function
press_speed!(dev)Press SPEED: cycle the stored knob speed 0 → 1 → 2 → 3 → 0. Stored only; it does not change turn_knob!. Ignored during a move.
MockSOLO.turn_knob! — Function
turn_knob!(dev, Δum)Turn the knob: jump instantly by Δum µm (rounded to µsteps, clamped to 0–50,000 µm). Ignored during a move.