当前位置:网站首页>Program to change the priority of the process in LabVIEW
Program to change the priority of the process in LabVIEW
2022-07-27 03:47:00 【LabVIEW development】
LabVIEW Program to change the priority of the process
stay labVIEW Can be called kernel32 Dynamic link library to change the priority of the process . You need two functions :GetCurrentProcess() and SetPriorityClass().
Yes 6 There are priorities to choose from , this 6 The priority and its identification code are listed below :
Free (IDLE): IDLE_PRIORITY_CLASS
Second low (BELOWNORMAL): BELOW_NORMAL_PRIORITY_CLASS
Ordinary (NORMAL): NORMAL_PRIORITY_CLASS
Secondary high (ABOVENORMAL): ABOVE_NORMAL_PRIORITY_CLASS
senior (HIGHPRIORITY): HIGH_PRIORITY_CLASS
real time (REALTIME): REALTIME_PRIORITY_CLASS
stay LabVIEW in , First, create a call library function node , And point to kernel32.dll( Generally located c:\windows\system32). The appearance of the function prototype after the call is :
unsigned longGetCurrentProcess(void)
Because this is called Windows Of API function , Call mode changed to stdcall(WINAPI). The second one calls the library function VI Similar to the first , Besides using SetPriorityClass function . After establishing the second call library function node, the function prototype looks like :
unsigned longSetPriorityClass(unsigned long handle, unsigned long priority)
alike , Call mode changed to stdcall(WINAPI). GetPriorityClass The return value of the function and SetPriorityClass Function handle related , The corresponding priority type is hexadecimal (hex). stay winbase.h In file ( Included in Microsoft Of WIN32 SDK in ), You can find declarations that define priorities . They are :
#defineIDLE_PRIORITY_CLASS 0x00000040
#defineBELOW_NORMAL_PRIORITY_CLASS 0x00004000
#define NORMAL_PRIORITY_CLASS0x00000020
#defineABOVE_NORMAL_PRIORITY_CLASS 0x00008000
#defineHIGH_PRIORITY_CLASS 0x00000080
#defineREALTIME_PRIORITY_CLASS 0x00000100
Use these values , You can specify the priority of threads . for instance , If you want to set the priority of the process to idle (IDLE), As long as a hexadecimal value of 40 Constant of .
open 、 Run the example in the attachment . When running the example , open Windows Task manager , Changing LabVIEW The priority of the program can be observed LabVIEW Priority status .

edit
Add picture comments , No more than 140 word ( Optional )
LabVIEW、LabVIEW Development 、LabVIEW Programming 、LabVIEW Program
Examples and information mentioned above , Both in word In the attachment in , Click to download . Learn more , Contact us .
边栏推荐
猜你喜欢

Spark Learning Notes (IV) -- spark core programming RDD

GetObject call timing of factorybean
![[1206. Design skip table]](/img/a9/ca45c9fedd6e48387821bdc7ec625c.png)
[1206. Design skip table]

Customer cases | pay attention to the elderly user experience, and the transformation of bank app to adapt to aging should avoid falsehood and be practical

Introduction to database - Introduction to database

【树链剖分】2022杭电多校2 1001 Static Query on Tree

Six determination methods of Worthington peroxidase activity

架构基本概念和架构本质

九方智投是正规公司吗?一起聊聊九方智投

How to optimize MySQL
随机推荐
Food chain (day 79)
Redis source code learning (33), command execution process
mysql如何优化
Take you to know what Web3.0 is
Source code analysis of openfeign
connman介绍
[1206. Design skip table]
How to interact with the server when the client sends an SQL message
明汯投资裘慧明:长期优异超额的背后考验的是团队的投研能力和策略的完整性
[regular] judgment, mobile number, ID number
Two help points distribution brings to merchants
Quick sequencing and optimization
Csu18m91 is used as the master controller of the intelligent scale scheme
Data analysis and disassembly method of banyan tree in Bairong
Database usage security policy
app端接口用例设计方法和测试方法
How to conduct 360 assessment
768. 最多能完成排序的块 II 贪心
Method of converting curtain article OPML into markdown
回归测试:意义、挑战、最佳实践和工具