LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

setting priority- common output

Solved!
Go to solution

priority.jpg

 

as shown i've 3 vi's which uses one common analog output. 


vi2&vi3 has the first priority, vi1 has second.

 

vi1 waits till vi2&3 complete using Analog output.

 

how can i acheive this?? what's the best option?? using queue or any variables to set priority?

 

the priority of the vi's depend on some predefined parameters.

 

thanks

 

RENN

Kudos always welcome for helpful posts 🙂
Message 1 of 14
(3,551 Views)
Solution
Accepted by RENN

Wrap all of the output related functions in a single Action Engine with an appropriate action for each operation. Keep your state information in a SR so you can implement your priority req's.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 14
(3,537 Views)

Hi RENN,

 

If by "priority" you mean "order of execution", then this reply will make sense.

 

LabVIEW is a data flow language. Subvis like your Vi1, Vi2, and Vi3 will execute when all of their inputs are valid.

 

In the picture you posted your vis would execute in this order: Vi1 then Vi2 then Vi3. To change the order of execution you will need to use a different structure for your program.

 

Is the desired execution order always the same or can it change based on the "parameters" you mentioned? Knowing the answer to this question will make it possible to give you a better answer.

 

In general, you should do a little reasearch on "state machines". That's probably going to be your best solution.

 

Also you might check the LabVIEW example called "Test Sequencer". You can find it with the NI Example Finder.

 

steve

 

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 14
(3,531 Views)

all the three vis run in the same loop, vi1 followed by vi2, then vi3

 

vi1 uses analogOut to set pressure to P1 at time t1 (t1,P1)

 

vi2, vi3 uses analogOut to set pressure to P2 at time t1 (t1,P2)

 

2 different pressure values to be set at the same time.here i set the first priority to vi2&vi3, then vi1 have to wait

 

STEP 1- vi2&vi3 uses analogOut1 to set pressure to P1 at time t1.

 

STEP 2- but vi1 waits till  vi2&vi3 finishes using analogOut1 and sets the pressure to P2

 

 

 

 

 

 

 

 

 

 

Message Edited by RENN on 11-05-2009 06:05 AM
Message Edited by RENN on 11-05-2009 06:06 AM
Kudos always welcome for helpful posts 🙂
0 Kudos
Message 4 of 14
(3,514 Views)
Did you Read Ben's response?  Your solution is fully implemented following his advice.

Paul
Message 5 of 14
(3,507 Views)

yess Definitely....i'm glad that Ben replied to me (in minutes).

 

i  thought my first explanation was not clear to some one.

 

so i've added some details.

 

thanks for all those replied!!!

Kudos always welcome for helpful posts 🙂
0 Kudos
Message 6 of 14
(3,505 Views)

hi Ben

 

please see the vi attached

 

thanks

 

Renn

Message Edited by RENN on 11-05-2009 06:56 AM
Kudos always welcome for helpful posts 🙂
0 Kudos
Message 7 of 14
(3,481 Views)

I'm on-site today so stuck at 8.2.

 

Post a screen shot and why am I supposed to look?

 

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 14
(3,476 Views)

hi ..please see the image

 

extract P&M.JPG

Kudos always welcome for helpful posts 🙂
0 Kudos
Message 9 of 14
(3,468 Views)

Hi Renn,

 

That does not look like an Action Engine. Please review my Nugget I linked in my fisrt reply and then post back with what action you think you will need and any questions associated with those actions.

 

Sorry but I don't write code on demand* (unless the is funding in place Smiley Wink )

 

Ben

 

* management monitors my posts and here and I hear about it when I posted anything useful. Smiley Surprised

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 14
(3,442 Views)