LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer/Consumer architecture: Optimize Queues

Hi

 

Thank you for your answer. I have corrected my code as follows: 

Snap9.jpg

0 Kudos
Message 21 of 35
(1,634 Views)

That looks  a bit cleaner.

 

One thing I'm wondering about it your error wires where you obtain queues.  You have them wired sequentially which is fine.  But you are also branching the errors in between and sending them into the loop.  It can't be seen if you are doing anything special with each branch of the error wire.  That construction is a bit unusual.

 

Unless you are doing something very special with each error branch (like acting on each specific error in some different way), you can probably delete all of those error branches.

0 Kudos
Message 22 of 35
(1,617 Views)

For goodness sake, straighten out those Queue wires!  When you unbundle the cluster, you get 5 wires.  Run the top one absolutely horizontally to its Enqueue function.  Position the second Enqueue right below the first one, as close as you can, and run the second Queue as straight as you can to it.  Repeat for the other wires.  You should end up with Queues that go primarily horizontally (instead of wandering along three sides of your Loop), and you can make the enclosing loop much smaller, hence easier to see and understand.  Also, do not bring Queues out of the Enqueue function -- they are not needed anymore inside this loop.

 

Now you should have 5 Enqueue functions stacked vertically, with 5 Queues and Error lines going in, and 5 Error lines coming out.  Immediately put a Merge Errors to end up with a single Error line that you bring out of the loop.  See how much neater that is?

 

But who cares about neatness?  Well, look at the "neat" diagram, and look at the diagram in your first post.  Which one looks easier to "see at a glance" what is going on in the loop?

 

Bob Schor

Message 23 of 35
(1,601 Views)

Oops, I didn't see your later post, where you did straighten out the wires.  Sorry for my tirade ...

 

BS

Message 24 of 35
(1,600 Views)

Actually, I have more to add I didn't notice on my earlier message about errors.

 

You have the queue references bundled into a cluster.  Good.  But you are still sending the individual queue references into the sequence frame.  I can't tell where they are still going to.  But you shouldn't need to do that because you can unbundle what you need from the cluster in other places iinside that structure.

0 Kudos
Message 25 of 35
(1,587 Views)

Hi

 

Thank you for your answers. I would like to show  you where are going my queue lines and error lines. I am using notifiers and I have 5 while loops (different loops for different hardware devices). I transfer data from one loop to the other using notifiers. I don't understand that I still sending the individual queue references into the sequence frame. Could you plese be more precise where is my error and I will correct it.

Snap10.jpg

0 Kudos
Message 26 of 35
(1,566 Views)
From labview style guide book
One page 99 may help you clean I attached sample for your info see if it help you.
Message 27 of 35
(1,546 Views)

Take the cluster wire into those loops and unbundle the references there where you actually need it.  No need for all the extra tunnels on  your outer sequence frame.

0 Kudos
Message 28 of 35
(1,530 Views)

It is very frustrating to look at a picture of part of a very large (spatially) VI.  How about attaching the VI, itself?  This would let us see the whole thing, perhaps (if we are sufficiently ambitious, or suffering from OCD) rewire it somewhat according to our own version of "Good LabVIEW Style", and thereby make much faster progress.

 

Please attach the VI.  Please ...

 

Bob Schor

 

P.S. -- I should mention that I'm about to start Jury Duty, so I might take a day or two before I can look at your VI, if you do attach it ...

0 Kudos
Message 29 of 35
(1,507 Views)

@Bob_Schor wrote:

[...]

 

P.S. -- I should mention that I'm about to start Jury Duty, so I might take a day or two before I can look at your VI, if you do attach it ...


http://fija.org/

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 30 of 35
(1,487 Views)