06-17-2024 12:55 PM
I have a strange error that I suspect is a bug, though I would love to find out otherwise. I'm using to producer/consumer with time-stamped data. In the consumer loop, I would like to be able to zero my data to a new start time, but doing so occasionally triggers an error out of the enqueue element inside the producer loop. Am I missing something here?
Error:
Error 1 occurred at Enqueue Element in Enqueue Error.vi
Possible reason(s):
LabVIEW: (Hex 0x1) An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
I'm running LabView 2024 Q1.
Other variations that have given me this error:
- enqueuing time as a double rather than a timestamp
- performing the time stamp subtraction before the data is enqueued
- enqueuing the data into two separate queues - sometimes only one throws an error
Solved! Go to Solution.
06-17-2024 01:03 PM
Don't have LabVIEW on this computer to test, but an issue I see looking at the code.
In your consumer you are flushing the queue; this will occur whether the queue has elements or not. If the queue is empty, then default data values occur and now your times will be less than zero. This triggers a stop, then destroys the queue leading to the error in the producer.
Use queue status to check the queue if it has any elements first, if so, then flush, otherwise wait until it has elements.
06-17-2024 02:53 PM - edited 06-17-2024 02:54 PM
Ah, thank you. That did it. Working code is shown below.
06-17-2024 04:09 PM
I would suggest you change your code just a bit more.
If your queue has a problem, you could be stuck in an infinite while loop waiting for elements. Some mock ups are shown below:
PS: Initialize your Shift Register with an empty array in the bottom loop; otherwise you may have some issues. If your code runs for a long time, your method of storing data is highly inefficient as your memory will resize constantly.
06-19-2024 04:41 AM
Good point. In my full program I'll be sure to address the infinite loop and memory management.
Thanks for your help!