Skip to main content

Omron Sysmac Simulator Driver

This project is a Python library that enables communication with the Sysmac Studio simulator using the NexSocket.dll installed with the Omron IDE. It can be used to exercise and unit test PLC projects in the simulator without the need to connect actual hardware. The main methods are similar to the APHYT Ethernet/IP project used for real Sysmac hardware on the network, so code can be reused to test both simulated and real systems. There are some limitations on simulated systems because the NexSocket.dll does not provide as much data as Ethernet/IP.

This code modifies and expands a GPL3 module released by Simumatik Digital Twin platform and the modifications:

  • Allow it to be used as a stand-alone Python interface to the Simulator
  • Variables can be assigned PLC data types in order to implicitly format the bytes during read and write operations
  • Can import a text file created by pasting the results of Sysmac Studio's "Export Global Variables" in order to define the data types of PLC variables automatically

Creating an Import File of Published Global Variables

Begin by exporting a formatted list of published global variables by navigating Sysmac Studio's menu structure to: Tools - Export Global Variables - CX-Designer

Export Global Variables Dialog

This should result in a dialog that alerts the user that the data has been copied to the clipboard

Pop Up From Export Global Variables Tool

Paste the results into a text file and save it in a location accessible to the Python code. The result should look something like this below:

Screen Cap of Global Variables Text File

The file "global_variables.txt", created using this process, is used in the example code below.

Example

The following code will connect to the running simulator

from omron_sysmac_simulator import *
import time

sim_driver = SysmacSimulator()
sim_driver.connect()
sim_driver.populate_from_file('global_variables.txt')

var_name = "hmiPositionTarget"
for i in range(5):
    print(sim_driver.read_variable(var_name))
    time.sleep(1)
    sim_driver.write_variable(var_name, 12.34)
    print(sim_driver.read_variable(var_name))
    time.sleep(1)
    sim_driver.write_variable(var_name, 0.0)

sim_driver.disconnect()

Metadata

Release files for omron-sysmac-simulator 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omron-sysmac-simulator 0.1.4
File Size Uploaded Provenance Actions
omron_sysmac_simulator-0.1.4.tar.gz 16.4 kB Without provenance Details for omron_sysmac_simulator-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for omron-sysmac-simulator 0.1.4
File Interpreter ABI Platform Actions
omron_sysmac_simulator-0.1.4-py3-none-any.whl Python 3 none any Details for omron_sysmac_simulator-0.1.4-py3-none-any.whl

Total release size: 36.0 kB

Release files / omron_sysmac_simulator-0.1.4.tar.gz

Download URL omron_sysmac_simulator-0.1.4.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7137bc6f59f470fb2260d5009bee356bdf52e572d5a31d571587f8258b2436a3
BLAKE2b-256 checksum
How to use checksums
72fe8c8c536d1f9d66682b1f1bd2d4be364a8733cec4cf8f991bec9b03ea75a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / omron_sysmac_simulator-0.1.4-py3-none-any.whl

Download URL omron_sysmac_simulator-0.1.4-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1d419eebdd03225711aef93a6e94c6c93003fb31d855cd0b2c186067791715c
BLAKE2b-256 checksum
How to use checksums
1bc5f28dde4be27313e2ba39bb5d443a566b2cc774e06c0e6891459e850c6776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for omron-sysmac-simulator 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page