From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Property's from within a While Loop

Solved!
Go to solution

Ok I'm stumped. I am watching the Front Panel for user changes from within a while loop. Depending on if the user leaves a slider in one of the many hundred's positions, or fifty's positions, I use a property node to change the scale and limits of the "fine tune" slider to either 0 thru 49, or 50 thru 99. This part works great, but each time the user changes the hundred's slider, I reset the "Fine Tune" slider's value to zero... Or try to. I either get a reseting back to zero every time the while loop goes around again, regardless of any value change from the Front Panel, or using a timer and a feedback loop I can make the case flip itself over to a blank case after a set time. The later ONLY works when I switch to the 50 thru 99 case, but not to the 0 to 49 case. In the 0 to 29 case it always leaves the value at max. It works fine otherwise. I saw in help, that the node only changes the data limits when the value changes and not when you call them in the property node. This may be part of my problem, but I don't know. I've left my code a mess trying stuff. If you need something to see, I will try to figure out how to show you a snippit. Labview 2009.

0 Kudos
Message 1 of 12
(3,067 Views)

I see a large block wall of text that reads like a run-on sentence.

 

Please attach an actual VI we can look at so we can match up what you are saying with something we can look at.

Message 2 of 12
(3,060 Views)

I can appreciate that. I went to figure out how to get that for you guys. Well, This is a png file. Not sure what that is yet, but I'm willing to learn.

0 Kudos
Message 3 of 12
(3,048 Views)

Well that is not a Vi, and it is a run-on sentance. I will experiment and then post a vi of the image. Thanks for your patience, and being willing to look at all.

0 Kudos
Message 4 of 12
(3,041 Views)
Solution
Accepted by topic author Hobbs23

I'm not even going to begin to figure out what you are trying to here.  All I can do is point out what doesn't make sense.

 

First.  A real VI is better.  You attached a VI snippet which is nice to give an image as well as runnable code.  EXCEPT.  the built-in LV snippet sucks.  (The Code Capture Tool is far better.)  Why, it butcher things like create explicit references to controls when there are property nodes that don't link to anything.

 

You have Rube Goldbergs in there.  Why would you feed a boolean into a Select statement to feed out a True or False constant.  Get rid of select and the constants and just wire up.  You've got the same thing!

 

You use the timer function or the Wait functions and check there outputs to see if they are greater than 100.  Guess what?  They are almost always greater than 100 because the output of all of those functions are the internal PC clock which starts at 0 when the PC boots up.  Eventually it will rollover back to 0.

 

There is a lot of boolean logic where you make a comparison (that is not what you think based on the paragraph above), NOT it, feed it out, feedback and iether do something or do nothing.   I don't know what that is all supposed to do.

 

One iteration For Loop.  Why?

 

Is this meant as a subVI.  It doesn't have a loop, so it only runs once.  If it is a subVI, then the references to listboxes make sense,  but since this was a snippet and not a VI, I can't tell if anything was ever connected to the connector panel.

 

First, I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

Then, I would look into Event structures as they will operate on events such as a value change event when a slide changes.

Message 5 of 12
(3,032 Views)

Thanks for the pointers RavensFan. This is in fact the original display template that I used when going through the training videos on Labview. I would test my understanding by programmitically controlling random test equipment that wasn't in use at the time.

 

Now that we have a prototype and wanted to test some display options I decided to just use this vi with all kinds of unused stuff in it. It had the basics and the section I grabbed showed the futility of my trying to overcome a problem that should just work.

 

I have known this was bad form, and so when the Engineer said he wanted me to experiment with yet another idea, and oh by the way all of the code has been changed in the newest prototype making your obsolete? Done

 

I am now starting with a fresh vi, I will see if I even have the same problem.

 

I took a stab at learning Event structures before from youtube but since this is not my primary function, I got pulled away for a couple months and never got to finish it. The links you provided will hopefully help me with that.

 

Thanks

0 Kudos
Message 6 of 12
(2,977 Views)

...Although it does not look as though Labview 2009 is equipted with Event Structures.

0 Kudos
Message 7 of 12
(2,952 Views)

Event structures have been around much longer than LV 2009.  The one question I have is what package level of LabVIEW are you using?  If you have the cheapest Basic version of LabVIEW, they did not have event structures.  (Though I think they may have been added to the basic package in recent years.)  The Full Development or Professional levels of LabVIEW definitely have/had event structures.

0 Kudos
Message 8 of 12
(2,948 Views)

@Hobbs23 wrote:

This is in fact the original display template that I used when going through the training videos on Labview.


Can you give a link or reference to this video?

(Did you find it on the NI site or it it some some random youtube video, for example.)

 

What is the meaning of "original"? Did you change anything at all?

0 Kudos
Message 9 of 12
(2,945 Views)

Thanks for the response RavensFan

Well that explains why I saw references to Event structures along side LV 2009, and why I can't find them in my package. We do have only the basic package of LV 2009.

 

It looks as though there are other ways to syncronize in my basic package. I would like to learn how to use the one that is as close to Event structures as possible. Any recommendations?

0 Kudos
Message 10 of 12
(2,921 Views)