05-11-2015 11:28 PM
Hi!
I'm currently using a producer consumer structure that is extremely slow and I hope to get some help in how I can speed it up.
One of the consumers opens a front panel wit two dots, these dots have a distance that can be increased/decrease with a rotary encoder (connected to LabVIEW via Arduino).
The problem is the following: There's a really (really really) noticable delay from when i turn the rotary encoder to the dots moving (Bonus question: Can one make the front panel not shut down, cause i think this is a part of the delay (that it needs to close and for every iteration)..
I've read around a bit and seen that many people make the consumer a subVI but i tried it and it didn't help.
I've attached the a file (if it helps, its kinda big). Hope that somebody can help!
Solved! Go to Solution.
05-12-2015 01:53 AM
05-12-2015 02:13 AM
Hi Firas,
which front panel are you talking about? There are a lot of missing subVIs…
- Please don't use that much local variables! Especially when the terminals are unused in the block diagram!
- Your BD is way too big! It doesn't fit on my FullHD screen - it uses atleast 6 of those screens!
Clean up! Modularize! Uses wires and THINK DATAFLOW!
05-12-2015 07:31 AM
Writing to the Value property node is EXTREMELY slow. Change those to use the terminals of the indicators. You also have a lot happening in your producer that could potentially slow you down (hard to tell without the subVIs).
Why are you limiting your queue to only be 1 element? That kind of defeats the purpose of a Producer/Consumer. Do not limit your queue size and use the normal Enqueue Element.
You should also use another loop for the logging of data.
Instead of using an array of booleans, it would be easier to understand your code if you used an Enum in your queue. That will make the case structure simpler and you will likely be able to break up your code to make it more modular.
05-12-2015 11:03 AM
Index Array is resizable by dragging down the bottom border. No need to split the array into different branches and have multiple Index Array's to get to different elements.
07-04-2015 04:59 PM
Seems like my answer didn't commit last time.... Sorry for that.
I thank you all for your answers. I redesigned the program with subVIs and less property nodes and local variables.
Seems to be a bit quicker and further progress is to be made.
Thanks!