LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

queue efficiency

Solved!
Go to solution

Hi everyone

 

I'm using queue in my project but when I turn on the datalog the vi get slow.

What is wrong in my code?

 

ps: to run the vi is necessary select an image

 

Thanks,

Alexandre.

Download All
0 Kudos
Message 21 of 26
(752 Views)

It's most likely that is because you are dequeueing in two places.  Whichever dequeue happens first will immediately remove the element from the queue, leaving the next dequeue to handle the next element.  Therefore, both dequeues would most likely be missing bits of data.  In this case, the delay results in that loop not triggering as much as it should.

 

As an aside, what are you trying to do with those Wait Until Next ms Multiple Functions?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 22 of 26
(743 Views)

I'm using the delay in order to get different execution time for the digital display and graph/datalog.

For the display I need 1 second delay to avoid some much oscilation.

For the graph and log I need record details about 100ms or less.

 

0 Kudos
Message 23 of 26
(734 Views)

@alexandresantos wrote:

I'm using the delay in order to get different execution time for the digital display and graph/datalog.

For the display I need 1 second delay to avoid some much oscilation.

For the graph and log I need record details about 100ms or less.

 


Do you want to display all values?  Do you want to log all values?  If not, then Queues are not what you want to use.  If you do want every value, then the waits make no sense since the loop rate will be determined from waiting for the queues to recieve data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 24 of 26
(730 Views)

No I don't. I need to display each 1 second and log each 10ms.

How can I determine these time for each one?

0 Kudos
Message 25 of 26
(716 Views)

@alexandresantos wrote:

No I don't. I need to display each 1 second and log each 10ms.

How can I determine these time for each one?


In that case, use a global variable to store the latest value of your read values.  Then your other loops run at whatever rate they want and read the last available value and do whatever they want with it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 26 of 26
(701 Views)