LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic creation of a control depending on the input

Solved!
Go to solution

Hi,

 

Is it possible to change a control on the front panel?

If the input is a string I want to show a string. If the input is a integer, I want to show a slider for example.

 

I have a plan to implement it on different tabs and show the tab which needs to be shown, but maybe there's a faster, more easy way????

 

Thanks for the help!

 

Kim

0 Kudos
Message 1 of 8
(3,361 Views)

@Kim Theuwissen wrote:

Hi,

 

Is it possible to change a control on the front panel?

If the input is a string I want to show a string. If the input is a integer, I want to show a slider for example.

 

I have a plan to implement it on different tabs and show the tab which needs to be shown, but maybe there's a faster, more easy way????

 

Thanks for the help!

 

Kim


Hi Kim,

 

The answer depends on how the data is coming into your code? e.g. is it being read from a file?

And what are the different data types that you would be expecting?

 

If you were able to attach some sample code this may also help.

 

Thanks,

 

Tori

 


 

Tori
Student
0 Kudos
Message 2 of 8
(3,349 Views)

Hello Tori,

 

I don't have any sample code yet.

We're just brainstorming.

 

Data will come from a dll. If I get an array of 3 integers for example, I will see this as a slider with min, max and value. I would like my control to be slider, if I get just 1 number I will display it as a simple control with 1 number...

 

I'm checking if this could work in Labview...

 

Thanks

0 Kudos
Message 3 of 8
(3,343 Views)
Solution
Accepted by KimT

Hi Kim,

Thanks for the additional info.

 

The dll and its manual define what the outputs can be and therefore you need to refer to the manual.

 

When calling a dll in LabVIEW, you have to define the output parameters statically and therefore data can only be of one type e.g. if define it as an array it will always be an array. For this look for the "call function node" in the Functions palette -> Connectivity -> Libraries & Executeables.

 

 

 


 

Tori
Student
Message 4 of 8
(3,332 Views)

Indeed, I will need to define my output using dll's...

 

Thanks for the quick answer!

0 Kudos
Message 5 of 8
(3,328 Views)

As far as my experience with .dlls goes you have to define the type of value given to or received from dlls in LabVIEW. You probably have a .dll which passes data via a union. Then you would have to settle for one of the data types.

 

As for your request:

You could put several indicators on the same location on the front panel and change their visibility according to the Data you receive. You can do this by property node for a couple of indicators. If you wanted to do this for many indicators it wouldn't look good- neither

executing nor on the BD.

 

Dammit! We're too late doc!



Remember Cunningham's Law
0 Kudos
Message 6 of 8
(3,326 Views)

Yes indeed this could be a solution.

We'll think about it some more!

 

Thanks

0 Kudos
Message 7 of 8
(3,322 Views)

Hi again Kim,

 

Sorry about the abrupt ending to my last post, it somehow got submitted half way through typing.

 

Glad my answer seems to have assisted you, but here's a little bit of additional info which may also help.

 

If the output of the dll is an array and the size of the array can define what we do with the data then for example a one element array can be displayed on a simple indicator whereas a 3 element array could be presented on a slider.

 

If you need more flexibility then the output of the dll would need to be a string. If there are no numbers in the string then we can treat it as simple text whereas if the string contains numbers then we can search for the separator of those numbers (e.g. a comma) and split these values to display them accordingly.

 

Hope this fully answers your questions!!

 

Tori

Tori
Student
0 Kudos
Message 8 of 8
(3,313 Views)