03-14-2019 08:54 AM
03-14-2019 09:26 AM
03-14-2019 09:27 AM
@Vishnu.R wrote:
Does anyone know how to reduce compiled code complexity of VI?
Have you tried reducing the source code complexity?
03-14-2019 11:12 AM - edited 03-14-2019 11:14 AM
@Vishnu.R wrote:
Does anyone know how to reduce compiled code complexity of VI?
What is your current complexity and what kind of problems do you encounter that you blame on code complexity?
Can you show us some code?
03-16-2019 06:29 AM
I have LV project originally developed in 2011. In 2011 its working fine. Now i am writing a same code in 2017.I am using Queued message handler (Design pattern LV2011).Code complexity of a VI is 9.6 after deleting some block of a code. Problem i am facing is whenever i add few code in this VI and try to save it ,LabVIEW becomes unresponsive for a while. RAM usage also increases.
03-16-2019 07:01 AM
I can't share my VI here. I have used subVI at most of the possible places.Project includes more than 200 subVI.
03-16-2019 07:08 AM
@Vishnu.R wrote:
I am using Queued message handler (Design pattern LV2011).Code complexity of a VI is 9.6 after deleting some block of a code.
You have WAY too much happening in that VI. Move your QMHs (loops) into individual VIs. Even better would be to put them in libraries so you can better manage each individual part. SubVIs will help even more. A fairly complicated QMH I recently made has a code complexity of 0.4. Your IDE should have no issues trying to compile that.
03-18-2019 09:15 AM
@Vishnu.R wrote:
Code complexity of a VI is 9.6
How do you determine that complexity number?
03-18-2019 11:45 AM
@RTSLVU wrote:
@Vishnu.R wrote:
Code complexity of a VI is 9.6
How do you determine that complexity number?
VI Properties -> Memory usage.
For another reference point, I have some legacy test software that's quite functional but isn't optimized and has grown quite a bit since its original effort. It needs a solid refactoring and even includes several 3D graphs, and its CCC is 6.4. If you're around 9 something, you definitely need to be putting more things in subVI's and simplifying logic. If you have VI Analyzer, you can use it to help find some things.
A solid rule of thumb: make sure your block diagram is viewable without scrolling left/right or up/down. If you MUST grow things for some reason, make sure you're only growing in one direction.
03-18-2019 11:55 AM
@Vishnu.R wrote:
Code complexity of a VI is 9.6 after deleting some block of a code. Problem i am facing is whenever i add few code in this VI and try to save it ,LabVIEW becomes unresponsive for a while. RAM usage also increases.
This is high and make recompiling very expensive. What are your compiler settings (tools...options...environment...last entry). Not only is the recompile slow, it will also force the compiler to take shortcuts in order to speed things up.
Note that this is local to the current VI and does not really depend on the number of VIs in the project (unless they are set to be inlined).