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.

Controlling a Traffic Signal Unit...<br />

The steps (from top to bottom) receive the names Switch1, Green2, Switch2, Green1, whereby Init of<br />

course keeps its Name. "Switch" should include a yellow phase, at Green1 TRAFFICSIGNAL1 will be<br />

green, at Green2 TRAFFICSIGNAL2 will be green. Finally change the return address of Init after<br />

Switch1. If you have done everything right, then the diagram should look like in the following image:<br />

Program SEQUENCE, First Expansion Level, Instruction Part<br />

Now we have to finish the programming of the individual steps. If you doubleclick on the field of a<br />

step, then you get a dialog for opening a new action. In our case we will use IL (Instruction List).<br />

Actions and transition conditions<br />

In the action of the step Init the variables are initialized, the STATUS of TRAFFICSIGNAL1 should be<br />

1 (green). The state of TRAFFICSIGNAL2 should be 3 (red). The action Init then looks like in the<br />

following image:<br />

3-6 CoDeSys V2.3

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

Saved successfully!

Ooh no, something went wrong!