Example tasks and prompts

From SweepMe! Wiki
Jump to navigation Jump to search

This page shows typical tasks that an AI assistant can do with SweepMe! 1.6.1.7 via the MCP server (SweepMe! Pro). For each task, you find an example prompt and the tools that the assistant usually calls. Adapt file paths, file names and parameter names to your setup. The assistant chooses the tools itself, so the order can differ. All tools are described in the MCP tool reference.

Before you let an assistant run measurements with real instruments, read Safe use of AI-controlled measurements.

Before you start

  • Start the MCP server and connect your AI application, see AI applications.
  • Prepare the sequences that you need and save them as .seq files. Give the assistant the full file path.
  • Say what the assistant must not do, e.g. "Do not start a measurement without asking me."
  • Try a new task first with Simulation drivers.

What is not possible in SweepMe! 1.6.1.7

  • The MCP server has no tools to edit the loaded sequence, e.g. to add modules or to change set values. Prepare one sequence per variant, or let an assistant with access to your files write the .seq file and load it, see Creating sequences with AI.
  • Via MCP, the assistant only gets the latest value of each parameter. The complete data of a run is in the data files, which the assistant can only read if it has access to your files.
  • The assistant does not see the user interface of SweepMe!, e.g. plots or message boxes. It only knows what the tools return.

Load a sequence and run it

Prompt:

Load the sequence C:\Users\Public\Documents\SweepMe!\Sequences\IV_diode.seq. Save the data to the folder Diodes with the file name Diode_A1. Start the measurement, wait until it has finished, save the data and tell me the last measured values.

What the assistant does:

  1. load_sequence with the file path.
  2. set_folder and set_filename. They are set after loading, because loading a sequence restores the folder and file name stored in it. The folder is a folder name inside the measurement folder of your profile, not a full path, see Measurement folder.
  3. start_run, then wait_for_completion.
  4. get_status to check whether the data has been saved, and save_data if not, e.g. if Auto Save Data is not checked.
  5. get_all_measurement_values for the last values.

Run at several set values with prepared sequences

As the assistant cannot change set values in the loaded sequence, prepare one sequence per set value in SweepMe! and save each variant under its own name.

Prompt:

In the folder C:\Users\Public\Documents\SweepMe!\Sequences\Annealing there are the sequences IV_25C.seq, IV_50C.seq and IV_75C.seq. Run them one after another. Save the data of each run with the file name Sample7 followed by the temperature, e.g. Sample7_25C. If a run ends with an error, stop and tell me what happened.

What the assistant does: For each sequence: load_sequence, set_filename, start_run, wait_for_completion and save_data. If a run ends unexpectedly, it reads the reason with get_debug_log.

The data must be saved before the next run starts, because the temporary folder is emptied at the start of each run, see Saving data.

If the assistant has access to your files, it can also create the variants from a template, see Creating sequences with AI. Check each new file before it is run.

Monitor a long run and summarize

Prompt:

A long-term measurement is running. Check every 10 minutes how far it is. When it has finished, give me a short summary of the last values of the temperature and the current, and tell me whether the data was saved.

What the assistant does:

  • get_status and get_measurement_progress for the elapsed time and the progress.
  • wait_for_completion with timeout_s = 600. If the run is still going after 10 minutes, the tool returns with timed_out = true and the assistant calls it again.
  • get_measurement_value or get_all_measurement_values at the end.

The assistant only sees the latest values, not the course of the whole run. For a summary of the complete run, let it read the saved data file (see below). Some AI applications limit how long an assistant may work on one request.

Read the latest values

Prompt:

Which parameters does the loaded sequence provide? Show me the latest voltage and current of the SMU.

What the assistant does: list_measurement_parameters to find the keys of the parameters, then get_measurement_value for each key, or get_all_measurement_values. The keys depend on the modules of the loaded sequence, see Parameter system.

Check driver and module versions

Prompt:

Which SweepMe! version is running? Which version of the driver SMU-Keithley_2400 is active, and which other versions are installed? Do not change anything.

What the assistant does: get_sweepme_version, get_driver_version and get_available_driver_versions. For modules, it uses get_module_version and get_available_module_versions, e.g. for the module SMU.

If you ask it to activate another version, it uses set_driver_version or set_module_version. This is only possible while no measurement is running. See Version manager for the meaning of the versions.

Find the cause of an error

Prompt:

The last measurement ended with an error. Read the debug log since the start of the run, explain what went wrong and what I can check.

What the assistant does: get_status, then get_debug_log with since_last_run = true. If needed, it checks the driver version with get_driver_version.

Ask before you restart SweepMe!, because the file debug.log is overwritten at each start. See also Debugging and Troubleshooting.

Analyze the saved data with Python

This task requires an assistant that can read files and run Python on your computer, e.g. Claude Code, OpenAI Codex, GitHub Copilot or Cursor.

Prompt:

Read the data file of the last run in C:\Users\Public\Documents\SweepMe!\Measurement\Lab1\Diodes, plot the current versus the voltage with a logarithmic current axis, and determine the voltage at which the current exceeds 1 mA. Save the plot as PNG next to the data file.

What the assistant does: It finds the data files in the folder, reads them with Python, e.g. with pandas, and writes a short script for the evaluation. The file format and examples for pandas and numpy are described in Loading data files. Each branch of the sequencer writes its own data file, see Saving data. The copy of the sequence that is saved with the data (<file name>_setting.seq) shows how the data was measured.

The MCP server does not return the full path of the data, so give the assistant the path of the measurement folder (File → Open Folder → Measurement Data). In the example, Lab1 is the name of the user profile. Check the script and the result, e.g. the selected columns and units.

Create a variant of a sequence

This task also requires an assistant that can read and write files.

Prompt:

Copy IV_diode.seq to IV_diode_fine.seq and change the sweep of the SMU to 0 V to 2 V in steps of 0.01 V. Keep the compliance at 10 mA. Then load the new sequence, but do not start it.

What the assistant does: It reads the existing file, writes the new file (see Sequence file format) and loads it with load_sequence. If the file is not valid, load_sequence returns an error and the assistant can correct the file. Check the new sequence in SweepMe! before you start it, see Creating sequences with AI.

See also