LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem passing reference

Solved!
Go to solution

Hello,

 I'm having trouble making a pass through reference. I have read the Ni write ups for both a pass through reference and a global variable but I'm still not quite understanding what to do. This is my issue I have a loop to which I have created a local variable called STOP ALL and linked it to the stop function for the loop, which completely stops everything in the program. I have included a pic of it below. So I went ahead and created a sub vi to which I want in the sub vi after its gone through the cases to signal the same ALL STOP command. The second pic below shows this, case 0 the Visa stops the motor control but the test is still running and that’s where I want the ALL STOP to be placed or it can be placed in a case after it doesn't matter to me, whatever is easier. I tried to reference it, use signal triggers but nothing seem to work. It seem like it should be pretty straight forward, so I must be missing something. Any help you can give me would be much appreciated.

 

Thanks for your time,

Steeltiki

 

Main

24170iA214B4D3BFF18355

24172i27B1729943A3D647

0 Kudos
Message 1 of 2
(2,451 Views)
Solution
Accepted by topic author Steeltiki

Well this is one of those times you should listen to the advice of the forum users.  At the risk of starting a flame war- Don't use globals or locals.  Read Bens nugget on AE's.

 

Now I strongly suspect the mechanical action you have on your Stop All control is set to "Latch"-  a Lactching boolean has four states. True, False, False transition and True transition.  When the boolean is set true it stays true only until it is first read then it becomes false again.  That is why you can only stop 1 loop at a time with a latching boolean.


"Should be" isn't "Is" -Jay
Message 2 of 2
(2,439 Views)