24.01.2015 Views

PLC Programming

  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5 - Editors in CoDeSys<br />

The contact is preset with the text "". You can click on this text and change it to the desired<br />

variable or the desired constant. For this you can also use the Input Assistant.<br />

It is possible to display the variable name with linebreaks. Also a separate comment can be inserted<br />

for the contact. For a description see 'Insert' 'Contact' .<br />

'Insert' 'Function Block' in LD<br />

Shortcut: +<br />

Use this command in order to insert an operator, a function block, a function or a program as a POU.<br />

For this, the connection between the contacts and the coils, or a coil, must be marked. The new POU<br />

at first has the designation AND. If you wish, you can change this designation to another one. For this<br />

you can also use the Input Assistant. Both standard and self-defined POUs are available.<br />

The first input to the POU is placed on the input connection, the first output on the output connection;<br />

thus these variables must definitely be of type BOOL. All other in- and outputs of the POU are filled<br />

with the text „". These prior entries can be changed into other constants, variables or addresses.<br />

For this you can also use the Input Assistant.<br />

'Insert' 'Coil' in LD<br />

Symbol:<br />

Shortcut: +<br />

You can use this command in the LD editor to insert a coil in parallel to the previous coils.<br />

If the marked position is a connection between the contacts and the coils, then the new coil will be<br />

inserted as the last. If the marked position is a coil, then the new coil will be inserted directly above it.<br />

The coil is given the text "" as a default setting. You can click on this text and change it to the<br />

desired variable. For this you can also use the Input Assistant.<br />

It is possible to display the variable name with linebreaks. Also a separate comment can be inserted<br />

for the coil. For a description see 'Insert' 'Contact'<br />

POUs with EN Inputs<br />

If you want to use your LD network as a <strong>PLC</strong> for calling up other POUs , then you must merge a POU<br />

with an EN input. Such a POU is connected in parallel to the coils. Beyond such a POU you can<br />

develop the network further, as in the Function Block Diagram. You can find the commands for<br />

insertion at an EN POU under the menu item 'Insert' 'Insert at Blocks'.<br />

An operator, a function block, a program or a function with EN input performs the same way as the<br />

corresponding POU in the Function Block Diagram, except that its execution is controlled on the EN<br />

input. This input is annexed at the connecting line between coils and contacts. If this connection<br />

carries the information "On", then the POU will be evaluated.<br />

If a POU has been created once already with EN input, then this POU can be used to create a<br />

network. This means that data from usual operators, functions, and function blocks can flow in an EN<br />

POU and an EN POU can carry data to such usual POUs.<br />

If, therefore, you want to program a network in the LD editor, as in FBD, you only need first to insert<br />

an EN operator in a new network. Subsequently, from this POU, you can continue to construct from<br />

your network, as in the FBD editor. A network thus formed will perform like the corresponding network<br />

in FBD.<br />

'Insert' 'Box with EN in LD'<br />

Use this command to insert a function block, an operator, a function or a program with EN input into a<br />

LD network.<br />

The marked position must be the connection between the contacts and the coils (Cursor Position 4) or<br />

a coil (Cursor Position 3). The new POU is inserted in parallel to the coils and underneath them; it<br />

contains initially the designation "AND". If you wish, you can change this designation to another one.<br />

For this you can also use the Input Assistant.<br />

CoDeSys V2.3 5-27

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

Saved successfully!

Ooh no, something went wrong!