LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change priority of a process programmatically using LV

I would like to change the priority of a process using LabVIEW. Does anybody know how to do this? I know how to change LabVIEW's process prorgrammatically--I found something on this site:
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/154489314a440d6486256bdd00607a2a?OpenDocument

I have implemented this solution (see attachment).
However, this solution only changes the priority of the LabVIEW executable.

Any help would be greatly appreciated.

Thanks,

Jeremy Levy
0 Kudos
Message 1 of 9
(5,958 Views)
Use VI server.
Open VI reference to a property node set to execution >> priority.
You can also set the priority manually through VI properties (control-i >> execution).
0 Kudos
Message 2 of 9
(5,957 Views)
Hi Dr. Levy!

If you want to set the proccess of a LV VI you can use the approach recomended by the other Jeremy.

Now on the other hand, if you want use LV to set the priority of of another process, you are going to have to get the handle to the window of the other process. I did a quick search and did not find a good example.

I will watch this thread and see if the above is the answer you needed.

On another thought;
When people usually ask this question it is because there is a performance issue they are trying to fix. In that case it is advisable not to alter the priority but adress the issue in other ways.

Let me know if you think we can help,

Thank you for everything you gave me.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 9
(5,957 Views)
Also see

National Instruments>>>LabVIEW>>>VI.lib>>>sysinfo.llb>>>Thread Configuration.vi

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 9
(5,957 Views)
Hi Ben,

thanks for taking the time to investigate my problem. I looked at the Thread Configuration vi in version 7, which is what I'm using now. Unfortunately it doesn't give info about processes outside labVIEW. I can't look at the diagram either because it's locked.

I guess what I need is some VI or .llb that will give me a list of processes, the way the Windows Task Manager does. Then I should be able to get the handle.

Glad to hear you're doing so well.
0 Kudos
Message 5 of 9
(5,957 Views)
There was one more good lead I did not chase down, The G-ToolBox.


I think he sells a license for less than $50 (US) and he has done a lot of work interfacing with Windows from LV.

Ben

A recent post from him to Info-LabVIEW follows.

"Falcon, Manny" wrote on Mon, 28 Jul 2003 11:18:16 -0700
>I am opening/running 4 instruments "soft front panel" (.exe files)
>using
>the
>LabView "System Exec.vi" embedded in one of my VIs. The problem is; when
>one of
>the soft panels open programmatically the one already open minimize to the
>bottom of the screen by the task bar. I would like to have all four "soft
>front
>panel" open and displayed at the same time on my screen each one taking 1/4
>of
>the screen
display.
>Does anyone know how to do this programmatically from LabView? I think I
>have to
>use API functions...
>
>Thanks

Manny,

With my G Toolbox, you can disable minimize to any window programmatically.
If that
doestn't work (Window Task Manager might find a way to bypass it), you can
restore
any minimized window programmatically, and move it to the location you want,
resize
it to 1/4 of the screen size. G Toolbox can be found on my web site, at:

http://gtoolbox.yeah.net

Good luck,

George Zou

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 9
(5,957 Views)

Would this (changing the priority of your application) work well if the intention is to ensure that a very processor hungry operation doesn't use too much processor time? (I would like to set my priority down).

Also, which LV functions should be used to achieve this?

Any other methods for achieving this that is better? I could insert a ms timer into my loops, but this also slows down my application even if no other applications need the processing power.

0 Kudos
Message 7 of 9
(5,684 Views)

Rodnebb,

Could you start a new thread on your question please?

A lot of things have changed over the last four years so there are now options that may help.

When you post your new question, please post your code and let us know exactly what challenges you are facing.

Thank you,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(5,672 Views)
I got here asking the question and you were right. There is a performance issue memory leak from a front panel published over the subnet.  If allowed to run too long LV crashes.  LV is currently running at normal priority.  I was thinking of elevating the process priority to provide more time.  Thanks..fishy
0 Kudos
Message 9 of 9
(5,197 Views)