24.01.2015 Views

PLC Programming

  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

What is What in CoDeSys<br />

Example of a LD network with an EN POU<br />

2.3 Debugging, Online Functions...<br />

Sampling Trace<br />

Debugging<br />

Breakpoint<br />

Single step<br />

Single Cycle<br />

The Sampling Trace allows you to trace the value sequence of variables, depending upon the socalled<br />

trigger event. This is the rising edge or falling edge of a previously defined Boolean variable<br />

(trigger variable). CoDeSys permits the tracing of up to 20 variables. 500 values can be traced for<br />

each variable.<br />

The debugging functions of CoDeSys make it easier for you to find errors.<br />

In order to debug, run the command 'Project' 'Options' and in the dialog box that pops up under<br />

Build options select activate option Debugging.<br />

A breakpoint is a place in the program at which the processing is stopped. Thus it is possible to look<br />

at the values of variables at specific places within the program.<br />

Breakpoints can be set in all editors. In the text editors breakpoints are set at line numbers, in FBD<br />

and LD at network numbers, in CFC at POUs and in SFC at steps. No breakpoints can be set in<br />

function block instances.<br />

Single step means:<br />

• In IL: Execute the program until the next CAL, LD or JMP command.<br />

• In ST: Execute the next instruction.<br />

• In FBD, LD: Execute the next network.<br />

• In SFC: Continue the action until the next step.<br />

By proceeding step by step you can check the logical correctness of your program.<br />

If Single cycle has been chosen, then the execution is stopped after each cycle.<br />

Change values online<br />

During operations variables can be set once at a certain value (write value) or also described again<br />

with a certain value after each cycle (force value). In online mode one also can change the variable<br />

value by double click on the value. By that boolean variables change from TRUE to FALSE or the<br />

other way round, for each other types of variables one gets the dialog Write Variable xy, where the<br />

actual value of the variable can be edited.<br />

CoDeSys V2.3 2-23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!