11-05-2009 04:57 AM
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
Solved! Go to Solution.
11-05-2009 05:24 AM
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
11-05-2009 05:44 AM
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
11-05-2009 06:04 AM - edited 11-05-2009 06:06 AM
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
11-05-2009 06:10 AM
11-05-2009 06:12 AM
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!!!
11-05-2009 06:54 AM - edited 11-05-2009 06:56 AM
hi Ben
please see the vi attached
thanks
Renn
11-05-2009 07:19 AM
I'm on-site today so stuck at 8.2.
Post a screen shot and why am I supposed to look?
Ben
11-05-2009 07:31 AM
hi ..please see the image
11-05-2009 08:01 AM
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 )
Ben
* management monitors my posts and here and I hear about it when I posted anything useful.