03-06-2015 10:33 AM
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.
03-06-2015 10:59 AM
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?
03-06-2015 11:10 AM
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.
03-06-2015 11:23 AM
@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.
03-06-2015 12:32 PM
No I don't. I need to display each 1 second and log each 10ms.
How can I determine these time for each one?
03-06-2015 12:47 PM
@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.