LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControl Boolean Off to On Behavior

Solved!
Go to solution

Morning all,

 

I'm dabbling in XControls for the first time, trying to make something simple to replace something not so much that's on the floor now. And I was wondering if anyone could help me figure out why it acts strange when going from off to on. By act strange I mean it goes from the scheme color to the default Boolean look while holding the mouse down to keep the off-on transition happening.

 

Edit: fixed the tester VI so no other dependencies required.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 1 of 6
(1,283 Views)
  1. Open the facade.
  2. Right-click on the button and select Advanced → Customize ...
  3. Click on the little wrench on the left end of the toolbar (it will become tweezers)
  4. Right-click on the button and select Picture Item
  5. Select the 4th item
  6. Place your desired image in the clipboard
  7. Right-click on the button and select Import Picture from Clipboard
  8. Close the custom control

Note: The 4 picture items are: False, True, T→F, F→T

Some buttons have 6 picture items.  The extra 2 being: False rollover, True rollover

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 6
(1,266 Views)

Thanks for your help! Switching to a System Boolean helped a lot to start lol. The picture is the thing that can change so it can't be hardcoded in that way. So what I ended up needing to do was create a fully transparent system Boolean by uploading a random picture and making it transparent.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 3 of 6
(1,255 Views)

Now that I got that bit solved, I'm working on getting the latching mechanical action correct, and have the control always initialize as false. My solution was to just wire a false constant to the Data out in the Facade VI as shown, but I'm not sure if that's the best way to go about it. But if I just wire it directly, then once the control is for example used to stop a VI, then the next time the VI runs the control reads as true still.

 

There's an old post about this that I wasn't sure about necroing or not, that you actually commented on Paul. Any advice on the latching behavior in my situation? Like I said this is an introduction to XControls for me, but I do like the idea of a System Boolean with extra customization options that are continually thought of and added.

Spoiler
FireFistRedhawk_0-1646746843469.png

 

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 4 of 6
(1,223 Views)
Solution
Accepted by topic author FireFist-Redhawk

The only way to do it is to have a background task polling the Xcontrol.

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 6
(1,211 Views)

I guess it would be less than ideal to have a background process for each of these buttons in a UI. Cool solution though and thank you for the code!

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 6 of 6
(1,207 Views)