LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Numeric Controls from Resetting to Default

Solved!
Go to solution

Hey Everyone,

 

I'm a neuroscientist using Labview to train mice to pull a lever. Unfortunately I have not written the following code, and the programmer is also unclear on how to solve this. Right now I have three control boxes labelled Threshold 1,2, and 3. This is the threshold for how far the mouse has to pull the lever back. I'd like to be able to adjust this on the fly, so that if the mouse is performing very well and I can decrease the threshold (forcing them to pull it more to get a reward).

 

The issue is that when a mousee successfully pulls the lever past the threshold, the thresholds reset to their default values. I believe this is because the program exits the main while loop when this occurs. Is there any way so that when the threshold is met, it doesn't return to its default value? Or alternatively I could change the default value to be the one I chose, but from my research so far one cannot edit the default value unless you're in edit mode.

 

My apologies if the code is unclear. I just began working with labview, but it would really help our training if I could make this small adjustment now. The programmer was a bit hasty in putting this together, so I would understand if there's a far more elegant way to program this. As I become more experienced, I'll probably rewrite it.

 

Thanks everyone!

 

-Alec

0 Kudos
Message 1 of 3
(2,195 Views)
Solution
Accepted by topic author asheff794

Looking at that, I'd suggest starting over from scratch.

 

There are a lot of Rube Goldbergs in there such as using the Select function to return a True or False in the event the incoming boolean is a True or a False.

 

They bothered to show the label for all of those Replace Array Subsets, but didn't bother to label all of those Graph Indicators so we know what each of them represent.

 

The boolean logic throughout is confusing, and there are a lot of shift registers and feedback nodes that seem to be unnecessary. I bet your problem of "resetting" stems from that.

 

But it is probably in the "Restart" case of the big case structure, there is an invoke node that is telling LabVIEW to reinitialize all the control values to their Default values, not just the numeric controls.  Try getting rid of that.

 

 

Message 2 of 3
(2,190 Views)

That was indeed what's causing the issue. This will help me a lot in the time being.

 

You're right though, recoding it myself will save a lot of headaches in the future as I try to add features. Thanks for your help!

0 Kudos
Message 3 of 3
(2,125 Views)