LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab page not giving command if not selected

Solved!
Go to solution

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.

0 Kudos
Message 11 of 16
(1,508 Views)

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!

0 Kudos
Message 12 of 16
(1,499 Views)

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!

 

LEDColumns.png

Similar methods could be applied to most of your code!.

0 Kudos
Message 13 of 16
(1,491 Views)

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 

0 Kudos
Message 14 of 16
(1,464 Views)

@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.

 

0 Kudos
Message 15 of 16
(1,459 Views)

@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...

 

0 Kudos
Message 16 of 16
(1,457 Views)