02-25-2012 09:17 AM
I have two questions for my .vi
1. I need same button to shown in more tabs(not just on one...). For example in my .vi I have button on first page, I would like to have same button also on page 2. How can I do that?
2. Which property and how can I use to do the next thing:
For example I have value "up" and "down". When I pressed some button I would like that this two values will automatically replace each other. Also labels must be replaced.
Solved! Go to Solution.
02-25-2012 12:50 PM
@hlod wrote:
I have two questions for my .vi
1. I need same button to shown in more tabs(not just on one...). For example in my .vi I have button on first page, I would like to have same button also on page 2. How can I do that?
This question has been asked dozens of times. Please perform a search before posting. Put the button on the front panel and move it over the tab using the cursor keys.
2. Which property and how can I use to do the next thing:For example I have value "up" and "down". When I pressed some button I would like that this two values will automatically replace each other. Also labels must be replaced.
This has also been asked before dozens of times. Please perform a search before posting. Use the Boolean Text property.
02-25-2012 01:08 PM
hlod wrote:1. I need same button to shown in more tabs(not just on one...). For example in my .vi I have button on first page, I would like to have same button also on page 2. How can I do that?
Saverio already pointed out a solution for the case where the controls should appear on all tab pages. Your question is not specific enough to tell if you actually want that or if the control should show on more than one, but not necessarily all pages. Please be more specific.
Typically if a button should be visible on all tabs, it probably belongs outside the tab structure.
@hlod wrote:
2. Which property and how can I use to do the next thing:
For example I have value "up" and "down". When I pressed some button I would like that this two values will automatically replace each other. Also labels must be replaced.
Please clarify what you mean by value for "up" and "down".
02-25-2012 01:18 PM
I don't know what you mean wtih cursor keys... My control must be shown on 2 tabs, but not on third one. I cannot put it outside of tabs, please understand this.
2. Which property and how can I use to do the next thing:
For example I have value "up" and "down". When I pressed some button I would like that this two values will automatically replace each other. Also labels must be replaced.
Please clarify what you mean by value for "up" and "down".
- datatype: DBL (double) -64 bit real
- controls !
-yes both must be visible, just swap their label and values( value 4.5444 from "up" become "down" value, and value from down become value up; same for label) ; location must be same as previous; Alyways both of them must be visible.
02-26-2012 04:50 AM
Still searching solution for both question;
For first one I tried this several times:
"Move it (using the mouse) outside of the tab, then move it (using cursor keys!) over the tab control. Now the button is on top (or can be made so with the order button in the menu) and is visible in each tab page..."
But when I move button outside of tab, my cursor keys have no control(nothing happend). I have LV 2011
02-26-2012 09:45 AM
I done something, but it's not working as I want. When I turn on "highlight execution", it's working as I want, but if I normally run, not.
I want that when I pressed button, UP, becom DOWN (caption and value), when button is on OFF, must be reseted all back to original!
Please see attachments .vi
02-26-2012 11:23 AM
02-26-2012 11:28 AM
I don't understand what you are doing anymore, since you are now apparently changing the captions of numeric controls. I also know how to spot a race condition, and that is what you have in your VI. You are writing to a control and reading from it, but you cannot know for certain whether the read or write will occur first. The way it's written, it's likely that the read from "Up" will occur before the write, but that is not 100% certain.
As for the Boolean Text, just change it on the control itself. Right-click on the Boolean and select Visible Items -> Boolean Text. Then change the text that's shown for when the Boolean is true, and what's shown for when it's false.
As for moving the button over the tab control, I do not understand what you mean by the cursor keys "not having control". You also said that you want the control over two tabs, but not the third. If this is the case, you can:
02-26-2012 11:29 AM
@hlod wrote:
When I turn on "highlight execution", it's working as I want, but if I normally run, not.
This behavior ALWAYS points to a race condition. In your particular case, you are copying value and caption from each control to the other control in parallel. There is no data dependecy between the two code segments so you can have many possible scenarios with random outcome, depending on the order things happen:
Also, your button is set to switch action, meaning as long as it is true, the value and labels will bounce back and forth 10 times per second. You need to ensure that the property nodes execute only once after the button has been pressed. The code needs to execute if the button goes true->false or false->true.
02-26-2012 11:39 AM - edited 02-26-2012 11:41 AM
Here's a quick draft how you could enforce execution order using an error wire.
(But I agree that there are probably much better ways to do all this. It is usually not recommended to warp the UI, because it confuses the user and leads to inconsitent user experience.)