05-19-2021 10:21 AM
Good evening,
I have a vi that dequeue arrays and pass them through a case structure using an input tunnel like in the image attached.
This application works correctly but abruptly, even if elements are correctly dequeues, I cannot find them in the case structure True case.
Is there someone that can solve me this issue?
THANKS!
Solved! Go to Solution.
05-19-2021 10:36 AM
It is very hard to debug a picture. Could you post the actual VI and possibly the subVIs?
There is a possibility you have 2 tunnels on top of each other. Not much more I can see there.
As an aside, you can do some massive cleaning up of your output string by using Format Into String.
05-19-2021 11:59 AM - edited 05-19-2021 12:01 PM
(You array is entering a case structure,. if it would be "tunneling through case structure" it would come out the other side, right?)
As has been said, we cannot really debug pictures, so please attach a simplified version of your VI. Where does the data get enqueued? And yes, many things are overly complicated and could be done much cleaner. Current code looks also very fragile.
05-19-2021 01:24 PM
Insulation_Test is the main Vi in which I have the problem.
05-19-2021 02:14 PM - edited 05-19-2021 02:29 PM
Hi Mariangela,
uh-oh: Rube-Goldberg alarm!
😄
@Mariangela_Camarda wrote:
This application works correctly but abruptly, even if elements are correctly dequeues, I cannot find them in the case structure True case.
Can you confirm by using probes there are elements in the array wire before the case structure, but then that array is empty inside the case? (Really check the Timeout? of the Dequeue operation!)
Is that case executed at all?
You really should cleanup that VI and remove all those Rube-Goldbergs. This will greatly improve readabilty of your code, and so will decrease the possibility of code errors!
This will ALWAYS result in "0" after the CompoundMultiplication:
There are a lot more bugs in your code!
Other improvement:
After removing the (Rube-Goldberg!) FOR loop. You can even remove one more subtract function after reading my comment…
05-19-2021 02:24 PM - edited 05-19-2021 02:25 PM
@altenbach wrote:
(You array is entering a case structure,. if it would be "tunneling through case structure" it would come out the other side, right?)
- Your enqueue has a 100ms timeout. Where are you handling the case where it times out instead of returning an array with data?
- The array that is getting dequeued will be processed by a subVI before entering the case structure. What does that subVI do with the data?
- How often is the case condition true?
As has been said, we cannot really debug pictures, so please attach a simplified version of your VI. Where does the data get enqueued? And yes, many things are overly complicated and could be done much cleaner. Current code looks also very fragile.
Pretty sure this is your problem. If the dequeue element doesn't get data after 100 ms it will spit out default data (an empty array). You need to wrap the "do stuff" code in a case structure wired to the "timed out?" output of dequeue element.
05-19-2021 02:28 PM - edited 05-19-2021 02:50 PM
You really need to architect that differently and either set the dequeue timeout to infinity or handle it otherwise.
(way too much unnecessary code overall. For example that subVI right before that case structure does not need a toDBL because the array is already DBL and you can remove the FOR loop without change in functionality)
EDIT: sorry, I had to deal with some other stuff and others already replied with similar concerns.
05-20-2021 03:12 AM
Thanks @GerdW... I've deleted the Rube-Goldberg situations and now I'll check for others!😥
05-20-2021 03:15 AM
EDIT: sorry, I had to deal with some other stuff and others already replied with similar concerns.
THANK YOU! "Repetita iuvant"!
05-20-2021 03:18 AM
I've just do it and it seems that all work properly!
Thank you!