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.

3 - We Write a Little Program<br />

For the other TRAFFICSIGNAL colors we need two more networks. To create the first one execute<br />

command 'Insert' 'Network (after)' and insert an EQ-Box like described above. Then select the<br />

output pin of this box and use again command 'Insert' 'Box'. In the new box replace "AND" by "OR".<br />

Now select the first output pin of the OR-box and use command 'Insert' 'Assign' to assign it to<br />

"GELB". Select the second input of the OR-box by a mouse-click on the horizontal line next to the<br />

three question marks, so that it appears marked by a dotted rectangle. Now use 'Insert' 'Box' to add<br />

a further EQ-box like described above. Finally the network should look like shown in the follwoing:<br />

Function block TRAFFICSIGNAL, instruction part<br />

In order to insert an operator in front of another operator, you must select the place where the input to<br />

which you want to attach the operator feeds into the box.<br />

Then use the command 'Insert' 'Box'. Otherwise you can set up these networks in the same way as<br />

the first network.<br />

Now our first POU has been finished. TRAFFICSIGNAL, according to the input of the value STATUS,<br />

controls whichever light color we wish.<br />

Connecting the standard.lib<br />

For the timer in the POU WAIT we need a POU from the standard library. Therefore, open the library<br />

manager with 'Window' 'Library Manager. Choose 'Insert' 'Additional library'. The dialog box appears<br />

for opening files. From the list of the libraries choose standard.lib.<br />

CoDeSys V2.3 3-3

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

Saved successfully!

Ooh no, something went wrong!