07-17-2017 01:50 AM
I just use case structure to separate I/Os on different tab. if i remove case structure i will have to put all code inside while loop which will be very big in size. is there any other option or finally i have to remove structure?
Thanks for your quick response.
07-17-2017 09:33 AM - edited 07-17-2017 09:40 AM
A case structure is not a tool to organize the diagram. Learn about modular program design, create subVI, create independent while loops. As an ugly bandaid, you could leave the current case structure, but make sure that it iterates through all cases at all times. If a lot of things need to be done, the code cannot focus on only one thing.
You have an incredible amount of duplicate code. Also instead of all these individual scalars, you could use arrays or clusters in many places. This would reduce the code size by orders of magnitude!
07-17-2017 10:11 AM - edited 07-17-2017 10:12 AM
altenbach wrote:You have an incredible amount of duplicate code. Also instead of all these individual scalars, you could use arrays or clusters in many places. This would reduce the code size by orders of magnitude!
For example, you get and format the current time 12x in parallel. Once is enough! Also, of you leave the input of get date/time unwired, it default to the current time. 24x too much code!!!
Now lets' look at your LED columns indicators. All you need is a tiny FOR loop and an array of LED (might need a few tweaks to get the exact same transitions, but I doubt lt it matters). Attached is a very simple comparison between the two methods. Mine uses 100x less diagram space. (image and attached code). All you need is the code in the yellow square!
Similar methods could be applied to most of your code!.
07-17-2017 11:22 PM
Thanks dear
i will really reduce project size. actually i am not expert i just learn labview by reading on internet and taking help from help menu. can you tell me what is constant "4" in while loop?
Thanks,
asif
07-18-2017 12:20 AM
@Asif138 wrote:
can you tell me what is constant "4" in while loop?
There is no while loop, just a FOR loop and the 4 is outside the loop (but used inside the loop). The 4 tells how many bits to left-shift the number from the iteration terminal. A left shift by 4 (of a positive integer in a suitable range) is equivalent to a multiplication by 2^4, i.e. 16. You can just multiply by 16 instead, same difference.
07-18-2017 12:29 AM
@Asif138 wrote:
i am not expert i just learn labview by reading on internet and taking help from help menu.
Thanks,
asif
Do you have an active licence? Then you can access the Core 1-2-3, etc. learning material online: http://sine.ni.com/myni/self-paced-training/app/main.xhtml
Even if you do not have access to this content, you can find some other tutorials for free:
http://www.ni.com/webcast/2898/en/
plus google for videos, lots of content on Youtube too...