Instrument Control
Instrument Control (menu Tools → Instrument Control, beta) lets an AI agent or you operate instruments through SweepMe!'s drivers, command by command, with every action checked and recorded. It is a tool of SweepMe! Pro and available from SweepMe! 1.6.1.9. For driver developers, it is the recommended workbench to test a driver and its communication commands.
What it does
- A bench describes the instruments: one entry per instrument channel with the driver, the port, the channel and optionally a role that says what the instrument does (e.g. "LED under test"). The bench starts with the Simulation drivers that come with SweepMe!, so everything can be tried without hardware.
- Limits restrict what may be asked of each instrument, per command and parameter (minimum, maximum, allowed choices, blocked commands). A value outside a limit or outside the range a driver declares is refused, never clamped. Agents cannot change limits.
- Sessions record everything: every command and raw byte with its time and caller, the values read and set, the data files and plots of routines, and notes.
- Procedures are stored measurements that run again with one click, by an agent, or with the module Procedure in a sequence. Test flows run procedures, operator instructions and checks as one fixed test and produce a PDF report.
- The Control tab shows every communication command of an instrument as a button: Read, Set or Run. Readings can refresh automatically. Here you can operate an instrument by hand while the bench is active.
Only you switch a bench on or off. Switching it on opens the instruments (each driver runs connect()); switching it off runs poweroff(), deinitialize() and disconnect() of every driver, releases the ports and ends the recording. A SweepMe! run and an active bench never run at the same time.
Getting started
- Start SweepMe!'s MCP server with the MCP server switch above the tabs (SweepMe! Pro). The Instrument Control tools are offered on that server while the dialog is open.
- Give your AI agent the URL of the server (right-click the MCP server switch → Copy URL; by default
http://localhost:8082/mcp). See AI applications for connecting the common AI applications. - Describe your bench in the Bench tab: driver, port (Find ports lists them), channel and role. Your agent can help with this.
- Switch the bench on with the Bench switch. The Agent control switch next to it keeps agents out while it is off.
- Ask the agent what you want to measure, e.g. "sweep the LED from 0 to 2.2 V and plot the IV curve", or use the Control tab yourself. The results are in the Sessions tab.
Instruments keep their last state when a task ends; nothing is switched off for you unless you ask for it or it is part of a procedure. The rules on Safe use of AI-controlled measurements apply.
Instrument Control and drivers
Instrument Control uses SweepMe!'s drivers as they are. What an agent or the Control tab calls are the communication commands of a driver: its public methods such as set_voltage or get_voltage, or those declared with @command from pysweepme.commands (the Driver API, SweepMe! 1.6.1.9). A declared command brings its types, units, ranges, choices, selectors and warnings along, so that the agent gets exact tool descriptions, the Control tab shows units and dropdowns, the set and read commands of one quantity appear as tiles, and every call is checked before it reaches the instrument. A driver without declarations works as well; its commands are then described from their names.
For driver developers this makes Instrument Control the recommended workbench: put the driver on a bench, let an agent or yourself call every command in the Control tab, and see immediately whether a declaration or a limit refuses a value. An agent may create or change drivers, and send raw commands to an instrument, only while Allow agents to create/modify drivers is ticked in the Bench tab; every driver change is listed in the Driver changes window, where you keep or revert it.
How to write and declare commands: driver guide (section 7) and Driver Programming.
See also
- AI applications: connecting an AI application to SweepMe!
- MCP tool reference: the tools of SweepMe!'s MCP server
- Safe use of AI-controlled measurements
- Simulation drivers: try Instrument Control without hardware
- Driver Programming and pysweepme