LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array tunneling through case structure

Solved!
Go to solution

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!

tempsnip.png

 

0 Kudos
Message 1 of 10
(1,184 Views)

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.


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 2 of 10
(1,171 Views)

(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.

0 Kudos
Message 3 of 10
(1,132 Views)

Insulation_Test is the main Vi in which I have the problem.

0 Kudos
Message 4 of 10
(1,112 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 5 of 10
(1,099 Views)
Solution
Accepted by Mariangela_Camarda

@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. 

0 Kudos
Message 6 of 10
(1,093 Views)

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.

Message 7 of 10
(1,086 Views)

Thanks @GerdW...  I've deleted the Rube-Goldberg situations and now I'll check for others!😥

0 Kudos
Message 8 of 10
(1,016 Views)

EDIT: sorry, I had to deal with some other stuff and others already replied with similar concerns.

 

THANK YOU! "Repetita iuvant"!

0 Kudos
Message 9 of 10
(1,009 Views)

I've just do it and it seems that all work properly!

 

Thank you!

0 Kudos
Message 10 of 10
(1,004 Views)