Debugging a driver extension - COPA-DATA/DriverExtensions GitHub Wiki

To debug a driver extension ensure that Visual Studio and zenon Runtime 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 12. Adjust for the version accordingly:
    C:\Program Files (x86)\COPA-DATA\zenon Software Platform 12\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 12\Engineering\DriverExtensions)
  2. Create a GenericNet driver instance in the zenon project and configure it to use the driver from that folder.
  3. Stop the Service Engine if it is already running and start 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.