SToneWindows 10/11MIT

Save and restore input scenarios in the STone simulator

Every time the STone PC simulator restarts, its input values are reset. This also happens when you download a new application from STone. STone I/O Simulator Presets takes care of the repetition: save an input setup under a name and restore it with one click. You can also enable Auto-Set to have the tool restore the selected scenario after each restart. It sets the simulated controller inputs, not your application variables, so it works with any STone project.

PresetTest - alarm conditionsTest - normal operation▶  SetAuto-Set after restartpresets.jsonU1U2U3U4U5U638.545.0-5.060.02.00.021.522.012.518.07.045.0ID1ID12U1 38.5 U7 10.0ID01-12 100101010010U1 21.5 U7 5.0ID01-12 111111110000pGD1

Why this tool exists

When testing a STone application in the PC simulator, you set inputs manually on its web page: analogue values with knobs and digital inputs with switches. The trouble starts after a restart — including every application download from STone. All values are lost, so you have to set them again. Repeat that after every code change and it quickly becomes tedious. Testing with everything left at zero is not much of an alternative.

The tool stores input values as named presets. It communicates with the simulator using the same local HTTP calls as the controls on its web page. This means values are applied to the simulated controller terminals, and your application reads them through its normal input path — including channel configuration, filtering and scaling. Select a saved scenario and click Set to restore it. With Auto-Set enabled, the tool monitors the simulator and reapplies the selected preset when it detects a restart.

How it works

  1. 1

    Start the simulator and the tool

    Start the simulator from STone and run STone IO Simulator Presets.exe. The tool connects to 127.0.0.1:43051, reads the list of channels the simulator reports and builds the window from it: 12 universal inputs and 24 digital inputs on a c.pCO, fewer on a smaller controller.

  2. 2

    Set the inputs

    Move the sliders or type values for the universal inputs, and switch the digital inputs with the buttons. The simulator follows at once, and the relay outputs row shows how your program reacts, the same way as the DO lamps in the simulator’s web page.

  3. 3

    Save the scenario

    Type a name in the Preset box, for example Summer, full load, and click Save current. The tool writes all channels to presets.json next to the exe. The file is plain JSON, so you can edit it by hand or send it to a colleague.

  4. 4

    Restore a preset manually or automatically

    Select a preset and click Set to send its values to the simulator. Alternatively, enable Auto-Set and the tool will restore the selected scenario whenever the simulator starts or comes back after an application download.

Features

01

A complete input scenario in one click

Save a complete set of analogue and digital input values as a single scenario. Common test cases — normal operation, high-pressure alarm or sensor fault — become entries in a list, ready to restore whenever you need them.

02

Automatic restore after a restart

The tool checks the simulator once per second. If it detects that the simulator has restarted or that all analogue inputs have returned to zero, it can reapply the Auto-Set preset. After downloading a new build, you no longer have to recreate the test setup manually.

03

Sets controller inputs, not application variables

The tool sets the simulated controller inputs rather than writing to application variables. Your program reads those values through System.IO, using the configured probe type, filter and scaling. This lets you test the normal input path used by the controller.

04

Uses the channels exposed by the simulator

The tool builds its interface from the channel list reported by the simulator, so it adapts to the selected controller. Channels in a preset that are not available on that controller are skipped, and the status line tells you which ones.

05

Presets in an editable JSON file

presets.json stores preset names and their channel values. You can create or edit presets by hand, include only the channels you need, or keep the file under version control alongside your STone project.

06

No installer required

The application is a single 134 kB EXE built for .NET Framework 4.8, which is included with Windows 10 and 11. There is no installer: copy the EXE to any folder and run it. The presets.json file stores your scenarios.

Screenshots

How the tool talks to the simulator

The STone PC simulator (SToneRuntime.exe) serves its local web interface on port 43051, along with an HTTP API. The tool uses two API calls:

GET /io/update.cgi                                   state of all channels (JSON)
GET /io/setvar.cgi?id=1&val=25.5&group=u&type=ai     set U1 to 25.5
GET /io/setvar.cgi?id=3&val=1&group=x&type=di        set ID3 to 1

The first request runs once per second and keeps the tool’s window in sync with the simulator, including relay outputs. The second request sets an input value; it is the same call sent by a web-page control when you move a knob. Values are sent one at a time because the simulator’s HTTP server handles only one request at a time.

Because the values enter through the simulated terminals, the program sees them after the channel configuration from uConfig (probe type, filter) and the scaling in System.IO. This is different from writing U[1].r from the Watch window, which bypasses the input path and only holds while the channel is virtualised with virtU.

The presets file

{
  "simulator": "127.0.0.1:43051",
  "autoSet": "Test - alarm conditions",
  "presets": {
    "Test - alarm conditions": {
      "saved": "2026-10-01T21:00:00",
      "values": { "U1": 38.5, "U2": 45, "U3": -5, "ID1": 1, "ID4": 1, "ID6": 1 }
    }
  }
}

simulator is the address of the simulator and autoSet the preset applied after each restart (empty switches it off). Channel names are the ones STone uses: U1 to U12 for universal inputs and ID1 to ID24 for digital inputs. Analogue values take two decimals, digital inputs are 0 or 1. A preset that lists only some channels is valid; the others stay as they are.

Requirements

  • Windows 10 or 11 with .NET Framework 4.8, which is part of Windows.
  • CAREL STone with the PC simulator. Tested with STone 2.0.7.1426.
  • Administrator rights are not required. The tool only writes to presets.json, stored next to the EXE.

Download

One ZIP archive containing the application, a presets file with two example scenarios, README.txt and the license.

STone I/O Simulator Presets v1.0.1

STone IO Simulator Presets.exe, presets.json with the presets Test - normal operation and Test - alarm conditions, README.txt and LICENSE.txt. Unzip anywhere and run the exe.

SHA-256 708055e4e1a498f39ada5553f42abdf0c0149bfe6e0a3ed7b54b3934a9e34d26

Download · 117 kB

The application is released under the MIT License: you may use, modify and redistribute it, including in commercial projects, as long as you keep the author’s copyright notice. The SHA-256 checksum is available in SHA256SUMS.txt. The EXE is not digitally signed, so Windows SmartScreen may display a warning the first time you run it.

Limits and residual risks

Frequently asked questions

Does it work with my own STone application?

Yes. The tool knows nothing about your program. It sets the simulated terminals of the controller, and the program reads them through its normal input path. The test application in the screenshots only lists the inputs on the pGD1 so that you can see the values arrive.

What is the difference between this and the knobs in the simulator's web page?

None in effect: the tool sends the same calls the knobs send. The difference is memory. The web page forgets every value when the simulator stops, and it has no way to save them; its Import and Export buttons only handle the channel names.

My simulator uses another port.

Type host:port in the Simulator box at the top of the window and press Enter. The tool reconnects and rebuilds the channel list. The address is kept in presets.json.

Can I write a preset by hand?

Yes. presets.json is plain JSON: each preset has a name, a date and a values object with keys such as U1 or ID3. A preset does not have to list every channel; the ones it leaves out stay as they are.

How much does it cost, and under which license?

The program is free and released under the MIT License. You may use, modify and redistribute it, including in commercial projects. The only condition is to keep the author's copyright notice: Hubert Lepiarczyk, IceLAB.

STone I/O Simulator Presets: Hubert Lepiarczyk, IceLAB (www.icelab.pl). MIT License. CAREL, STone, c.pCO and pGD1 are trademarks of CAREL Industries S.p.A. This is an independent project and is not affiliated with CAREL.