LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make the Labview software neat and clean?

Solved!
Go to solution

Hi all,

I have a Labview program which is good in function. But the code looks so mass, because there are some many variables need to be initialized. I want to change the structure or do something to reduce the variables and variable initialization. But I don't know how. Please help me to make it neat and clean or give me an example to learn.

Thanks,

Steven

 

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

Hi Steven,

 

well, use subVIs and references to initialize controls...

Using arrays for similar controls seems a good idea, too.

 

Btw. I don't know the UI nor the kind of application you're working on, but "AssType" may have a different meaning for you 😄

Best regards,
GerdW


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

Hi GerdW,

 

Could you give me example about how to use subVIs and references to initialize controls? Will there be a lot of references labels on this page? Thanks. 

.

Using arrays for similar controls seems a good idea, too. I want to use Arrays too. But how to change the size of array to display. For instance,  user one wants to test 5 items, so the first 5 items in the array should be displayed; user 2 wants to test 7 items, so the first 7 items in the array should be displayed. I don't know how to control it, so I have to control it separately. Please tell me how to do it. Thanks.

 

About 'AssType' thing, It is funny. I suppose to make AssemblyType in short not in funny. I will change it.

Thanks.

 

Steven

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

Hi Steven,

 

both questions can be summarized to using property nodes "the easy way":

- you can get references to all controls of a frontpanel by a property node of the frontpanel

- you can set number of visible array elements using a property node of the array. (Btw. usually this results in an ugly UI. Use table/listbox with scroll bars instead...)

Best regards,
GerdW


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

Hi all,

 

I have the answer about how to user array for the similar items. Here is my question that I still no answer.

 

Could you give me an example about how to use subVIs and references to initialize controls, so that the code will look neat and clean? 

 

Thanks. 

Steven

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

You can use the VI method that reinitializes all FP controls.

RI.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 8
(3,584 Views)

Hi Paul_cardinale,

 

I think this is what I am looking for. I want to try this VI method things. But I don't know where I can find it.

 

Thank you.

Steven

0 Kudos
Message 7 of 8
(3,552 Views)
Solution
Accepted by topic author StevenInToronto

Hi Steven,

 

all you need is in the HELP - no need to search elsewhere...

Best regards,
GerdW


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