LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

increase button for slide does not work correctly

Solved!
Go to solution

Hi everyone,

 

I want to make a button to increase a slide value according to user's mouse operation:

 

1. the button pressed less than 0.5 s, the slide increase 1

2. the button pressed more than 0.5 s, the slide increase more

 

I have done the second function, but I don't know how to realise the first function.

 

Here is the vi. Please Note, I would like to keep the while loop run all the time.

 

I appreciated it if someone could help me. Thanks a lot.

 

 

0 Kudos
Message 1 of 9
(3,964 Views)

Hi cctl,

 

see attachment: you just need one more decision (before or after delay setpoint)...

 

And you don't need to convert to string when you want to display hex or octal formatted numbers...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,959 Views)

Hi Gred,

 

Thanks for your kindly help.

 

I am sorry I did not describe the problem clear enough. 

I hope I just press the 'X++' button for a short while, like 0.5 s (which means the 'Elapsed Time' indicator on the front panel is less than 0.5s), the program could consider that I just pressed the button only once, and then after this button is released, only 1 value add to slider.

 

Would you please help me, thanks again.

 

 

 

0 Kudos
Message 3 of 9
(3,943 Views)
Solution
Accepted by topic author cctt126

Hi cctt,

 

you need to check for "events" like "button pressed" and "time elapsed" like shown in the attached VI.

 

In the long term you better try to use the event structure for handling events...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,938 Views)

 

Hi Gerd,

 

 

 

 

 

Great job, thanks. The attached vi looks more closer to what I want.

 

 

Actually, I would like to make a button for the slider to instead of the slider's increasement/decreasement button.

Because the slider's increase/decrease button moves too slow when hold press, and the size is too small. So I used the 'X++' button to instead of them.

 

 

 

I really appreciated if more suggestions could give me for design the button.

 

 

Thanks a lot.

 

 

 

 

 

 

 

 

0 Kudos
Message 5 of 9
(3,933 Views)

Hi cctt,

 

look in the help for "customizing controls". You will even find videos for that topic on the NI.com website...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(3,929 Views)

Yes, you are right, using event structure is a good way to solve this problem.

To help others, I attached a simple example, see attachments. 

0 Kudos
Message 7 of 9
(3,856 Views)

For Labview 8.0 version

 

0 Kudos
Message 8 of 9
(3,855 Views)

Thanks for sharing cctt126!

 

You may also want to consider uploading your examples to the NI Developer Community here - the community is set up to share and provide feedback on example code and will make it easier for others to search for and locate your contribution.

 

Regards,

Tom L.
0 Kudos
Message 9 of 9
(3,846 Views)