LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid code doubling of analog front panel elements

Hi,

 

this is a rather conceptual question. In the front panel of my VI there a two elements (which display some data) having the exact same functionality. At the same time they have to be able to be controlled individually, i.e. the front panel appearance is not the same. If I do some calculations and do not immediately display the result I can just use a subvi thereby avoiding repitition of code. I am not sure how to circumvent this problem with front panel elements. How could I do this?

 

Regards

Volfi

0 Kudos
Message 1 of 4
(2,516 Views)

Hi volfi,

 

In the front panel of my VI there a two elements (which display some data) having the exact same functionality.

To display data you would use indicators.

Which "functionality" do your indicators need?

 

At the same time they have to be able to be controlled individually, i.e. the front panel appearance is not the same.

So you use two different indicators, when their "appearance" is different?

What's the problem with "controlling individually"? When they get their data from different data sources you just need to wire them…

 

If I do some calculations and do not immediately display the result I can just use a subvi thereby avoiding repitition of code. I am not sure how to circumvent this problem with front panel elements.

How is "doing calculations" related to "displaying data in indicators"?

Why is this a problem you need to circumvent?

 

Can you attach an example VI to better illustrate your "problem"?

Are you talking about XControls? (Or do you need their functionality?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,507 Views)

If you have two different style indicators for the same data, just branch the wire going to them.

 

(Note that many indicators have optional secondary indicators. So if you also want a digital display for your gauge, chart, or tank, for example, just unhide that. From looking at beginner code here in the forum, many don't seem to be aware of that feature).

 

I don't understand your question about subVIs and what "problem" you are trying to circumvent. Please provide significantly more details, maybe a use case, and maybe even attach some simplified code that shows the main points.

 

 

0 Kudos
Message 3 of 4
(2,438 Views)

May not help the OP but the title of this thread reminded me of an adventures from years ago.

 

Some L code had been developed by some grad students in one of those post-cod think tanks. They wanted to double the application to allow doing the same test on two different widgets at the same time. They called me in because LV was throwing an error and crashing.

 

It was then that I learned that LV 6.1 ONLY supported 660 controls and indicators on a FP

 

Yes I got them fixed up (smiley-wink).

 

Spoiler

 

Earned a nice atta-boy letter and a long term customer to boot!

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(2,419 Views)