[Home]Simulating A Hm2 Eth Driver

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Components for Simulating Hardware in LinuxCNC

In some situations, it’s useful to simulate hardware rather than testing directly on a real machine. Especially when programming new routines where hardware could be damaged when something fails. This github-repository (link on buttom of page) provides components and configuration examples to create a realistic simulation environment in LinuxCNC, using your existing .ini and .hal files.

The goal is to reuse your actual machine configuration and detect hardware availability on startup. During startup the ip-address of the mesa-card is pinged, and in case of no replay the simulation component is loaded.

This is especially useful for:

The mock of the 7i76e currently supports the configuration of the card with parameters: e.g. "num_encoders=1 num_pwmgens=1 num_stepgens=3 sserial_port_0=20xxxx".

On the github page you also find a detailed list of currently mocked and stubbed Pins and Parameters

    Note: Let me know if you need Pins and/or Parameter stubbed/mocked to be able to simulate your machine.
    Stubbed Pins / Parameters: These connectors exists for wiring but no additional logic included in component.
    Mocked Pins / Parameters: These connectors are contains simulated logic

I tried to write the component in a generic way, so it should be quite easy to add missing pins or even adapting a 7i95 or 7i96 card.

Hardware Simulated

This project currently includes simulation support for:

Idea and Workflow

    Use the same .ini and .hal files for both real and simulated machines.
    At startup, a Tcl script checks whether the hardware is reachable (via ping).
    If not reachable, the mocked version (component) of the hardware is loaded.
    Additional simulation components can then be included based on this logic.

For details and latest version, please checkout the github project page on: https://github.com/pkl42/linuxcnc_components_sim


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited August 3, 2025 3:04 am by Pkludwig (diff)
Search:
Published under a Creative Commons License