07-26-2011 03:34 AM
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
Solved! Go to Solution.
07-26-2011 04:05 AM
@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
07-26-2011 04:11 AM
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
07-26-2011 04:24 AM - edited 07-26-2011 04:31 AM
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.
07-26-2011 04:28 AM
Indeed, I will need to define my output using dll's...
Thanks for the quick answer!
07-26-2011 04:29 AM - edited 07-26-2011 04:30 AM
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!
07-26-2011 04:31 AM
Yes indeed this could be a solution.
We'll think about it some more!
Thanks
07-26-2011 04:39 AM
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