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: 

Programmatically Add/Delete slider

Solved!
Go to solution

Hello,

I'm using System Horizontal Pointer slide.

pointer.jpg

 

And I want to add slider programmatically. I know how to add this manuel but I want to add/delete sliders programmatically.

 

add-delete.jpg

Could you please help me ?

 




Yasemin Barutçu
Electrical And Electronics Engineer
0 Kudos
Message 1 of 23
(3,917 Views)

With VI Scripting enabled (LV 2009 and higher, Options>VISever) there is a method named "Add Slider".

However, this method is only available when the VI is in Edit Mode.

 

 

Christian

Message 2 of 23
(3,901 Views)

So there is no way to do this right? 😕


Yasemin Barutçu
Electrical And Electronics Engineer
0 Kudos
Message 3 of 23
(3,893 Views)

Not during runtime.

 

What you can do without scripting is to manually add a maximum number of slides during edit time.

You can use property nodes "Active Slider" followed by "Slider Colors". Set the color to transparent. Maybe this is a workaround for your need.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 23
(3,890 Views)

Why not simply use the property node "Visible".  Set it to TRUE to see it and FALSE to hide it.

That way, you do not need to delete the object from the front panel.

 

Although not usually recommended, you can superimpose objects on the front panel so that it appears as if you replaced it with another one.  Simply set the "Visible" property accordingly for both objects.

0 Kudos
Message 5 of 23
(3,885 Views)

@Ray.R wrote:

Why not simply use the property node "Visible".  Set it to TRUE to see it and FALSE to hide it.

That way, you do not need to delete the object from the front panel.

 

Although not usually recommended, you can superimpose objects on the front panel so that it appears as if you replaced it with another one.  Simply set the "Visible" property accordingly for both objects.


There is no Visibility property for the Slider, just for the Frontpanel Object as a whole.

0 Kudos
Message 6 of 23
(3,882 Views)

Yes thats right. If I do visible false, all object will dissappear.


Yasemin Barutçu
Electrical And Electronics Engineer
0 Kudos
Message 7 of 23
(3,871 Views)

OOps.. My bad..

 

I didn't realize that there would be multiple sliders and some would be removed...\

I guess the easiest approach is what Norbert suggested..

0 Kudos
Message 8 of 23
(3,858 Views)

No_...

 

What is it that you are trying to accomplish?  How will this be used?  Perhaps someone can suggest an alternative which might be easier to accomplish or work better for your application.

 

What is the maximum number of sliders which would ever be required?  It seems likely that more than 2 or 3 sliders begins to become quite confusing for the user, especially when they are set close to the same value.

 

Lynn

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

it will be unlimited or maybe willbe maximum 20. It is complicated when the number is unknown.


Yasemin Barutçu
Electrical And Electronics Engineer
0 Kudos
Message 10 of 23
(3,847 Views)