Debugging zenon Control during Runtime

To extend interface functionality of zenon for special projects it is necessary to develop modules or dll files which can take on special computation or visualize different interface controls.

Two different methods exist for testing or debugging the dll that has been developed: either by attaching to the process or by starting the zenon Runtime as an external program. Developers can attach Visual Studio to the zenon Runtime process through:

Debug menu > Attach to Process… and the Attach to Process dialog opens

 

Debugging_AttachProcess

 

The following steps are needed for debugging a dll:

  1. Develop a dll
  2. Embed dll in zenon editor
  3. Set a breakpoint in code design (F9)
  4. Run zenon
  5. Attach Visual studio to the zenon Runtime process

After that, if the end user uses the control, the breakpoint will be activated if the breakpoint is placed inside the invoked code.

 

Debugging_breakpoint

 

In another method of testing and debugging of the control without attaching to the zenon Runtime process, the Project properties must be set.

Project properties > Debug Part > Set Start external program by using the browse button

 

debugging_ExternalProgram

 

The following steps are needed for debugging a dll:

  1. Develop a dll
  2. Embed dll in zenon editor and make a runtime file
  3. Set breakpoint in Code design
  4. Set Start external program option in Project properties to the path of zenon runtime program
  5. Run the control via Visual Studio (F5)

Visual Studio builds the dll first and then runs the zenon Runtime program, because a zenon project which contains the dll control has been created before, therefore any update in dll is applied to control in Runtime without opening the zenon Editor.

(The COPA-DATA Blog Team would like to thank Parisa Moosavi from EDAG Production Solution for her zenon insights)

Tags: ,

Leave a Reply