17.02.2013 Views

Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.4.1 Installing a Thread<br />

Function Libraries<br />

A thread is the executive part of a process with several<br />

threads being allowed to run at a time (parallel program).<br />

Thread properties:<br />

The operating system assigns a time slice of a defined<br />

size (in µs) to the program identified by its index and runs<br />

that program as a process. When the time slice comes to<br />

its end, the thread is terminated and the next process is<br />

run. It is the first thread's turn again when all other<br />

registered processes have been completed. The RUNS<br />

parameter allows you to restrict the number thread runs.<br />

When the count of runs is complete, the thread is killed<br />

and needs to be set up again if and when required.<br />

Parameter Type Value Explanation<br />

NPOU_Idparam WORD module index<br />

TSLICE WORD<br />

100..<br />

6500<br />

RUNS WORD 1..<br />

65553<br />

else 800µs<br />

size of time slice, in µs<br />

0 always<br />

number of runs<br />

Only one thread can run at exactly the same time. Your<br />

program should provide for just 1 program module being<br />

set up as a thread.<br />

Modules defined to be threads must not also be started<br />

directly by other parts of the program. You otherwise run<br />

the risk of producing incalculable program runs.<br />

71

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

Saved successfully!

Ooh no, something went wrong!