Cicode Programming Reference > Editing and Debugging Code > Debugging Cicode > Debugging functions

Debugging functions

To debug a function:

  1. Run the Cicode Editor.
  2. Open the file containing the function you wish to debug.
  3. Click the Toggle Debug button, or choose Debug | Start Debugging.
  4. Note: If the current project is not running, CitectSCADA compiles and runs it automatically. The bug in the bottom right-hand corner is green when debugging.

  5. Insert a breakpoint where you want to start debugging.
  6. From the View menu, select any debug windows you want to use. If you are unsure, you can use them all.
  7. Initiate the thread by calling the function. You can do this directly from the Cicode window in the Kernel, or by using a function, etc.
  8. The function will break at the specified breakpoint. You can then use the step tools to step through and trace your function.
  9. Click the Toggle Debug button to stop debugging, or choose Debug | Stop Debugging.