17.02.2013 Views

Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual

SHOW MORE
SHOW LESS

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

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

Function Libraries<br />

start<br />

PLC_PRG<br />

Example:<br />

You wish to turn a program module called<br />

"TimerTask1ms" into a timer task. Add the following code<br />

lines to the PLC_PRG module.<br />

VAR<br />

Index: WORD;<br />

TTime: WORD:=1;<br />

Flag: UINT;<br />

END_VAR<br />

IF Flag = 0 THEN<br />

Index := INDEXOF ( Timertask1ms );<br />

Flag := Create_Timertask(Index,TTime);<br />

END_IF<br />

Timer task and PLC_PRG:<br />

"TimerTask1ms" interrupts the cyclic program, PRG_PLC,<br />

every 1ms. The number of times the timer task is run and<br />

the time it takes to actually run it adds to the execution<br />

time of PRG_PLC.<br />

timer task<br />

next<br />

PLC_PRG<br />

timer task<br />

1<br />

1<br />

ms<br />

ms<br />

runtime of PLC_PRG<br />

1 ms<br />

* PLC_PRG can be interrupted by other processes (see<br />

section 4.4.1)<br />

78 E 700 GB<br />

next<br />

PLC_PRG<br />

timer task<br />

PLC_PRG<br />

end<br />

time

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

Saved successfully!

Ooh no, something went wrong!