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 />

Calling an action:<br />

An action is called up with . or ..<br />

Regard the notation in FBD (see example below) ! If it is required to call up the action within its own<br />

block, one just uses the name of the action in the text editors and in the graphic form the function<br />

block call up without instance information.<br />

Examples for calls of the above described action from another POU:<br />

Declaration for all examples:<br />

PROGRAM <strong>PLC</strong>_PRG<br />

VAR<br />

Inst : Counter;<br />

END_VAR<br />

Call of action 'Reset' in another POU, which is programmed in IL:<br />

CAL Inst.Reset(In := FALSE)<br />

LD Inst.out<br />

ST ERG<br />

Call of action 'Reset' in another POU, which is programmed in ST:<br />

Inst.Reset(In := FALSE);<br />

Erg := Inst.out;<br />

Call of action 'Reset' in another POU, which is programmed in FBD:<br />

Resources<br />

Libraries<br />

Notes: Actions play an important role in blocks in sequential function charts, see Sequential Function Chart.<br />

The IEC standard does not recognise actions other than actions of the sequential function chart.<br />

You need the resources for configuring and organizing your project and for tracing variable values:<br />

• Global Variables which can be used throughout the project or network<br />

• Library manager for adding libraries to the project<br />

• Log for recording the actions during an online session<br />

• <strong>PLC</strong> Configuration for configuring your hardware<br />

• Task Configuration for guiding your program through tasks<br />

• Watch and Receipt Manager for displaying variable values and setting default variable values<br />

• Target system settings for selection and if necessary final configuration of the target system<br />

Depending on the target system and on the target settings made in CoDeSys the following resources<br />

also might be available in your project:<br />

• Sampling Trace for graphic display of variable values<br />

• Parameter Manager for data exchange with other controllers in a network<br />

• <strong>PLC</strong>-Browser as controller monitor<br />

• Tools – availability depending on target – for calling external tool programs from within CoDeSys<br />

You can include in your project a series of libraries whose POUs, data types, and global variables you<br />

can use just like user-defined variables. The libraries standard.lib and util.lib are standard parts of the<br />

program and are always at your disposal.<br />

CoDeSys V2.3 2-7

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

Saved successfully!

Ooh no, something went wrong!