LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Typdef used as a control and indicator

Solved!
Go to solution

Hello,

 

In the process to tidy up my code without needing to rewrite it completely, I decided to put the "UI" part as a strict typedef and display it in the front VI. Then I exported the block diagram in a subVI and used the control reference to drive the subvi. It works very well (event if other solutions might be better, but need much more time to migrate to) except one detail:

 

I use my typedef to create the control for the Subvi, but I also use it as the indicator. However, since I'm primarily using it as a control, all elements in the cluster are changed in a "control form". I could partially solve this problem by disabling the parts that I use as indicator to avoid that the user changes the values. however my Numeric indicator for example are still displayed as a control with the controlling arrows.

 

I there any way to avoid this ?

control view.PNGtypedef.PNG 

 

Thank you and best regards,

 

Yannick

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

If a cluster is an indicator, all it's content is displayed as indicator. If it's a control, everything in it will be displayed as control.

 

AFAIK, there is no way around it.

0 Kudos
Message 2 of 8
(3,333 Views)

what a pity ...

 

Any other way to describe completely the UI of a subVI and use it in the front panel and subVI?
Describing control and indicator separately would be a bit messy in my opinion.

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

In fact, what I need would be a pane but stored in an external file.

which should be an option in any proper developing language in my opinion.

 

I precise that I can't use sub-panels, since I'm developing for a CRio device.

0 Kudos
Message 4 of 8
(3,308 Views)
Solution
Accepted by topic author YannickB

Hi Yannick,

 

I there any way to avoid this ?

Hide the increment/decrement buttons!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(3,295 Views)

Thank you for this very simple but efficient answer 🙂

I didn't know this was possible. Yes it solves my problem.

 

Now I just hope this way of using the control will work as intended and not cause any bug.

Since it doesn't seem to be the intended use.

0 Kudos
Message 6 of 8
(3,286 Views)

You probably want to set the disabled property to "disabled and greyed" so the user doesn't think they are supposed to input something there.  Or set the property to "disabled" and color the controls like indicators.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(3,276 Views)

wiebe is right, however increment/decrement arrows can be hidden (right-click > Visible Items) and the controls disabled.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 8
(3,275 Views)