LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer consumer structure with event loop

Highlighted

Hello, please I want to realize a consumer producer structure with loop event. Because I have a main VI which in function when a button is pressed launches a sub vi as described below:
- Action B1 Launch VI1 with its front panel after treatment,
- Judgment VI1
-Action BP2 run VI2 with this front face
The structure according to my research will have to be conceived with a queue design.
The BP1 will have to launch the sub vi image processing and the BP2 the sub vi Control command, the sub vi command and supervision 1,2,3 are pus VIs of the VI command and supervision. The main VI is Synthesizer
Thank you

0 Kudos
Message 1 of 12
(312 Views)

@Ernest97 wrote:

The structure according to my research will have to be conceived with a queue design.


Not at all. Many ways to do that.

 

For instance, in the event structure, start the task dynamically. Give it a user event as input when you start it. Register the event for the user event, and it will get the event when the task is completed. The user event can also be a value signaling executed on a control reference.

0 Kudos
Message 2 of 12
(268 Views)

please on example i will use it to do my one task..!!

thank you

0 Kudos
Message 3 of 12
(245 Views)

@Ernest97 wrote:

please on example i will use it to do my one task..!!


Open LabVIEW.  Click "Create Project".  It will allow you to create several Producer/Consumer Projects that include quite a bit of documentation.

 

Open LabVIEW.  Click (under the File Menu) "Niw ..." (be sure to click the one with trailing dots).  In the Drop Down, choose "From Template, Frameworks, Design Patterns" where there are several Producer/Consumer examples.

 

Study the examples.  Play with them.  Modify them to suit your situation.

 

Bob Schor

0 Kudos
Message 4 of 12
(234 Views)

@Ernest97 wrote:

please on example i will use it to do my one task..!!

thank you


IMHO, If you don't get any of the concepts, you'll need to learn them.

 

I'm not going to make an example, not because I'm lazy (which I am Smiley Very Happy) or lack the time (I doSmiley Frustrated), but because it wouldn't help you in the long run.

 

Starting a VI dynamically isn't that hard. Neither is using user events. Nor value change events on a control reference. Peace it together in an event structure, and you're halfway there.

 

I simply won't be doing you a favor by assuming your requirements, and cook up something that 'sort of' does what you want. I'll be handing you a tool that you won't be able to handle (jet).

Message 5 of 12
(216 Views)

Thank you for your sincere response, I understand your concern but I tried several approaches but they do not provide any solution. Well then I would like some clarification on the approach to follow with the event structure.
Thank you

0 Kudos
Message 6 of 12
(193 Views)

@Ernest97 wrote:

Thank you for your sincere response, I understand your concern but I tried several approaches but they do not provide any solution. Well then I would like some clarification on the approach to follow with the event structure.
Thank you


Every approach should have an event structure.

 

In a traditional Producer\Consumer, simply put an event structure in the Producer. Depending on the event, make the Producer produce something for the Consumer to consume.

 

If you want to look into my suggestion (which isn't the best per se, I don't know all the variables), you'd end up with an event structure in a loop. Depending on the event, start a dynamic VI. That will look something like this:

Dynamic Start.PNG

If you're starting this\trying this out and get stuck, we will review your code if you post it.

0 Kudos
Message 7 of 12
(186 Views)


I try to modify my VI according to your instructions but I do not know how to connect the vi to open with the node. In addition I find a project that tries to illustrate a bit the features that I seek to represent in the project file contains a file W8.lvlib I do not know what it refers.
Moreover, according to my observation, this file contains the different cancellations, and each of them has the extension .ctl.
  I send it to you he is called IHM with my project MEMOIRE.
Thank you

0 Kudos
Message 8 of 12
(164 Views)

my project vi MEMOIRE

0 Kudos
Message 9 of 12
(158 Views)

@Ernest

It looks like this is what you're looking for/missing: https://zone.ni.com/reference/en-XX/help/371361P-01/lvhowto/acbr_call_and_collect/

Your current Action 1 needs a VI reference, that one should be opened through an Open VI reference. You seem to be close, just that last wall to climb over.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 12
(144 Views)