Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 1008 Bytes

BackgroundThread.md

File metadata and controls

22 lines (14 loc) · 1008 Bytes

Background Threads

BackgroundThread.cs

Minimal required:

PLCnext Engineer

PLCnext Engineer

This is an example how to run background threads with PLCnext, outside of the realtime application. Nevertheless it must be implemented cooperative.

ATTENTION: Please see descrition for threads.

Background threads have a lower priority than the all of the PLC threads which means that thery have a priority lower than the "DEFAULT" thread of the PLC project. This means it can have the .Net-Priority 1 or 0.

The main use of background threads is to separate long lasting tasks from the realtime supervised PLC threads. Therefor the tasks are transfered to the low prior thread which sets a "done" flag to signalize that a task was done.