EasyManuals Logo

Allen-Bradley SoftLogix 5800 User Manual

Allen-Bradley SoftLogix 5800
272 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #135 background imageLoading...
Page #135 background image
Rockwell Automation Publication 1789-UM002K-EN-P - January 2015 135
Develop External Routines Chapter 7
Thread Priorities in a Multithreaded External Routine DLL
If you use Microsoft C or C++ to develop your external routine, use only the
‘_beginthread’ C runtime function, as shown above in the example. By using the
‘_beginthread’ and ‘_endthread’ calls verifies that the system resources are
properly allocated by the Microsoft C runtime library.
When developing a multithreaded DLL, you must link with the multithreaded
version of the C runtime library. Use the Multithreaded DLL option in your
project settings for the run-time library option.
Keep in mind that the default priority assigned to a thread upon its creation is
THREAD_PRIORITY_NORMAL. This priority level (priority level 2) is
reserved for running the controller's periodic tasks. Set the priority of the newly
created thread to something more appropriate so as not to interfere with the
execution of periodic tasks in the controller. The example above shows how to set
the thread priority to be equal to the priority of the parent thread, or
THREAD_PRIORITY_IDLE if the thread does not perform any time-critical
operations.
The following table shows the mapping between thread priorities and the
controller's task priorities:
Continuous TaskTHREAD_PRIORITY_LOWEST
Periodic Task (pri. 3)THREAD_PRIORITY_BELOW_NORMAL
Periodic Task (pri. 2)THREAD_PRIORITY_NORMAL
Periodic Task (pri. 1)THREAD_PRIORITY_ABOVE_NORMAL
If you do not set the priority of a thread created via the “_beginthread” runtime
function to the recommended values, periodic task overlap faults or watchdog
faults can occur.
ATTENTION: Do not set the priority of any thread to a value greater than
THREAD_PRIORITY_ABOVE_NORMAL because it will interfere with the
operation of critical controller system threads and may result in unpredictable
behavior of the controller.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley SoftLogix 5800 and is the answer not in the manual?

Allen-Bradley SoftLogix 5800 Specifications

General IconGeneral
BrandAllen-Bradley
ModelSoftLogix 5800
CategoryController
LanguageEnglish

Related product manuals