LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Priority of VI's using same queue

Hi

Am using 3 VI's accessing a single Queue, the jobs done by these VI as follows

VI no.1 -- writes noncritical commands(check status of device) in to Q as FIFO (enqueue element function)
VI no.2 -- writes time critical commands(action commands) in to Q as LIFO (enqueue element from opposite side function)
VI no.3 -- reads the queue and writes in to COM port.

These VI's will form an application running in an RT PXI.

Am unable to decide what priority should be given to each VI, I am not sure if I can give timecritical priority to VI no.2 as it is used as a SUB VI, can I give it an subroutine priority instead? Also what priority should I give other VI's.

Thanx for reply

Arun
0 Kudos
Message 1 of 4
(2,905 Views)
Hi

The com port communication can have different thread than the other ones. The priority on this one can be low, since the serial communication is slow by definition.

As I see it only Vi 2 needs to write a time stamp into the queue, so this one need to go fast and undisturbed. Give it the data acqusition thread and high priority. If it does not write a timestamp to the queue, it does not matter how you organise all priorities, because all vi (1&2) are the same important.

Vi 1 is of least importance and it should not load the system.

I would not give any of them the subroutine priority, not even time critical priority. I check it by myself, that oscilating between "normal priority" and "above normal" gives the best results in terms of utilization of processor. But of course I do not know your application.
hope it helps
Pawel
0 Kudos
Message 2 of 4
(2,904 Views)
Hai

Thanx for the reply, my application is to control 64 power supply which are communicated using serial. in normal condition Vi no.1 would be running and continuesly writing the commands in the Q to the COM port and reading reply from power supplies(these are to chek the status of Power supply), these commands are filled by VI no. 2. But in case user sends a command i write in to the same Q
but from opposite end, this is done by VI no.3 but VI no.3 is called from several places, is it Ok if i give it high priority?
also there is a possibility that the Q may be accessed by several VI no.3 at the same time. please give me your suggestion and advise on it.

Thanx
Arun
0 Kudos
Message 3 of 4
(2,896 Views)
Arun

I propose you make yourself a diagram, when you will write the requirements on how fast the selected vis should react and how critical is their execution time.
Then use a "vi profiler" from tools->advanced->profile vi.. and check the time statistics on those vi to see how much time evrey of those take.

Find it out and think, where you can improve stuff.

Hope it helps.
If now, come back with a more speccific description, people in this newsgroup will help you (including myself ;-), if I can)

regards
Pawel
0 Kudos
Message 4 of 4
(2,890 Views)