Skip to content

Debugging a driver extension

COPA-DATA Product Management edited this page Jun 9, 2026 · 10 revisions

To debug a driver extension ensure that Visual Studio and the zenon Service Engine are executed in the same user context (same user and same elevation level).

  1. In project properties, select tab "Debug" and select as launch setting "Executable". Select the GenericNet.exe file within the zenon installation directory. Example for zenon version 16. Adjust for the version accordingly:
    C:\Program Files (x86)\COPA-DATA\zenon Software Platform 16\Engineering\GenericNet.exe
    Add the option --ipc=TCP as a command line argument.

  1. Ensure, that the driver DLLs are copied into a sub directory of the DriverExtensions-Folder (C:\Program Files (x86)\COPA-DATA\zenon Software Platform 16\Engineering\DriverExtensions)
  2. Create a GenericNet driver instance in the zenon project and configure it to use the driver Extension from that sub-folder.
  3. Stop the Service Engine if it is already running and start a debug session for the driver project in Visual Studio. Check if a new process called GenericNet.exe is started.
  4. Set a breakpoint within the InitializeAsync-Method of your driver's code.
  5. Start the Service Engine from the Engineering Studio.
  6. The break point is hit and you can start to debug the driver extension within Visual Studio.

Possible reasons, why the InitializeAsync-Method is not called:

  1. The zenon project does not have a GenericNet driver configured that uses your specific driver extension.
  2. Visual Studio and Service Engine are not started in the same user context or one of them is started with Administrator permissions.
  3. The driver extension or dependencies are not copied to the configured sub directory of DriverExtensions folder.

Alternatively, attaching to a running GnericNet.exe process from within Visual Studio, may also allow debugging parts of the DriverExtension.

Clone this wiki locally