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.
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.
05-10-2018 09:05 AM
Hello,
I am wondering if there is any way to programmatically change an indicator type. I have a gauge indicator and i wish to replace it to a numeric indicator with a toggle switch. This toggle switch will allow me to go back and forth in between the types. One way to do it is by having both indicators in the front panel and use the switch to hide or show but it would be nicer if i don't need to add both and maybe a property node can do it.
05-10-2018 09:48 AM
Showing or hiding a control is probably your best option. You can also put each control in a tab, and then make the tab transparent. Then when you want to see one control you change the tab to show the control you want. Programatically creating controls at run-time is not possible. It would be like changing the compiled code for an application, as that application is running. Other options do exist too like creating subpanels of controls but that complicates things even more. You might also consider doing the tab method, but then leaving the tab visible so the user can decide what view they want by changing the tab control.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-10-2018 10:03 AM
Thanks for your time. You mentioned "Programatically creating controls at run-time is not possible". But i am not willing to create an indicator. I am just willing to replace it with a new type (change it from dial to numeric). Is this considered creating a new indicator??
05-10-2018 10:10 AM - edited 05-10-2018 10:16 AM
You already got some good advice. Another option would be to show both at all times. All gauges have digital displays that can be optionally shown. You could even move the digital display over the gauge, similar to a mileage display on the speedometer of classic cars. Since the FP space is already occupied, you won't gain much by hiding the gauge. The digital display is useful for e.g. copy-paste the current value or showing the value with more precision.
Of course if you make the digital display large enough to cover the gauge, you can just programatically show/hide the digital display to get the desired effect. (image has the elements offset to show both).
05-10-2018 10:51 AM
@josear04 wrote:
Thanks for your time. You mentioned "Programatically creating controls at run-time is not possible". But i am not willing to create an indicator. I am just willing to replace it with a new type (change it from dial to numeric). Is this considered creating a new indicator??
Editing the source, while the VI is in a reserved state isn't possible. You can't even do this from the IDE, so of course you can't do it programatically. You must first stop your VI, then you can edit it, then you can run it. You could create a scripting VI that does this, but the result wouldn't be what you want, and would only work within the IDE.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-10-2018 02:20 PM
Thanks for all the responses. I greatly appreciate it. ill work with all the options you guys mentioned.
05-10-2018 03:38 PM
@josear04 wrote:
Thanks for all the responses. I greatly appreciate it. ill work with all the options you guys mentioned.
Is this post really the solution to the question? Just sayin'......