Friday, January 1, 2021

Running Tasks in Parallel instead of series using NI LabVIEW

 We have been developing large-scale projects in LabVIEW in our Mumbai factory since 2005 like this for ISRO (Indian Space Research Agency).

I made this article for those who are new to LabVIEW in order to quickly understand how you can run tasks in parallel using NI LabVIEW. LabVIEW makes that super easy which programmers who are experienced with other languages find daunting even using latest Integrated Development Environments.

Even many intermediate-level LabVIEW programmers will find this informative. If you do not know LabVIEW but are working on projects which involve NI LabVIEW, this information will be extremely valuable. Many projects these days utilise PLC with LabVIEW, so if you are programming using 'Ladder' for any PLC such as Siemens, Allen-Bradley etc. and someone else in your team is building the SCADA using LabVIEW - make sure he/she understands how to run tasks in parallel instead of serially using NI LabVIEW.

This is especially important as most CPUs these days are multi-core!

It's expected that you already know 'While-loops', 'Timed-While-loop' and 'Shift-registers' in LabVIEW.

LabVIEW provides an architecture to take full advantage of multi-core processors. If you do not explicitly program longer tasks using such architecture, Windows will offer very less power & advantage of multi-core.


There are many aspects of parallel programming. Even the simplest task parallelism looks like this - 



In short, suppose we are getting an array over and over (say an analog value sent in batches to us continuously), next we need to apply some Math like Fourier or Filtering etc. on the array – and finally we need to save that array on disk. So instead of doing this in series, as  in  - 


We can parallelize the 3 tasks instead as in – 






This will help in every task that uses data-sets in series.

Now the real power of LabVIEW is in the ‘Timed-While Loops’ which literally let you assign each core of the CPU to each loop. And LabVIEW takes care of the complex work of achieving it. You just need to put the core-number on each diagram.




So, now you can exploit the full advantage of multi-core CPUs using LabVIEW. If you have any questions, please feel free to comment them in this post, I'll be glad to address those!

Wednesday, March 14, 2018

Great Cloud account for extending your hard-disk

Hello Guys!

Blogging after a long time!

I found a cloud service which has an encrypted folder for absolute privacy.. I think no one else (so far) has it. All of its features are awesome.

You can find it here - https://wn.nr/4P4CYH

pCloud is Swiss based cloud service. Absolutely amazing.

Hope you like it..

Aniket

Saturday, June 20, 2009

LabVIEW Myths & Realities

I have come across certain LabVIEW myths that need to be killed (Let there be light):


1.
Myth: You need to purchase LabVIEW from NI to run / use LabVIEW VIs legally

Fact: You can run LabVIEW VIs legally as an executable on any number of machines without any purchase from NI. All you need is the LabVIEW Run-time engine which is free. Only developers need to purchase LabVIEW license from www.ni.com/labview for making / editing LabVIEW code / logic.


2.
Myth: LabVIEW supports NI hardware only

Fact: NI hardware forms a small sub-set of the instruments supported by LabVIEW. LabVIEW can be used to control most of the instruments in the world (unless the instrument vendor exclusively prohibits) and can even program micro-processors, FPGA etc. so as to make your own instruments.


3.
Myth: LabVIEW is for small applications. Large applications are better programmed in C/C++, Java, Visual Studio etc. LabVIEW is not a 'real' programming language.

Fact: LabVIEW is an advanced 4th generation programming language whose domain is instrumentation. It follows the graphical programming paradigm. All above languages (to date) are text-based, 3rd generation languages & are not domain specialized. They are hence used for a wide variety of applications where as LabVIEW is used for mainly Measurement & Automation. LabVIEW successfully solves huge engineering problems and can create great applications. Visit: http://www.youtube.com/view_play_list?p=0E5B77FAEBF4EE0D&playnext=1&playnext_from=PL&v=W1czBcnX1Ww or http://sine.ni.com/cs/app/doc/p/id/cs-740
I have listed certain LabVIEW industrial applications here for whom I have the permission.  
Besides, I have seen many factories and have helped program a few that are on total automation based on LabVIEW Real-time.


4.
Myth: PLC based system is more rugged and LabVIEW on PC cannot be deterministic.

Fact: A cRIO based system has everything a PLC has plus all the obvious advantages of LabVIEW. LabVIEW is the only language I know that can so effortlessly make a standard PC / Laptop a real-time target.

Saturday, June 6, 2009

Getting to know A New kind of Science...

Although LabVIEW is my tool of choice, I occasionally use others too.

Currently, my curiosity is aroused by Mathematica after knowing it being used in Wolfram Alpha.
Reading the book on new science online (obviously can't wait till Amazon ships a copy to me in India) and am fascinated by what it says on Logic!

I'm overwhelmed with thousands of queries, so decided to fire one question right away to Dr. Stephen Wolfram.

Yes, correct. I'm not kidding. All questions from users of crazy engineers are answered here: http://www.crazyengineers.com/dr-stephen-wolfram-wolframalpha-mathematica-a-new-kind-of-science/

My question: Are the new rules of logic upon which computation can be based, radically different from conventional logic? Alternatively, is it an extension of conventional logic + something else?

Dr Wolfram's answer: Computation is ultimately about following rules—of any kind. Traditional logic represents just one class of rules. There are lots of others that can be used. One of the surprising discoveries from NKS is just how easy it is to find rules that can support universal computation. And that’s important if one wants to base computation on elements like molecules. About logic itself: I wondered just how special the axiom system of logic that we use is. One can enumerate the whole space of possible axiom systems, and then one finds that logic is about the 50,000 system one encounters. There’s really nothing special about it, except the role it plays in human intellectual history.

Thursday, October 23, 2008

Excepting some Controls (and Indicators) while Initializing whole VI controls and indicators to default

Need arises that sometimes you re-initialize values of everything in a VI to their default values. However, you just need to leave value of few controls and indicators as is. The above diagram explains how to do it. Use a sequence structure with 3 frames. Variables of those controls and indicators are placed in 'Read from' mode in the first frame. Variables of same controls and indicators are placed in 'Write to' mode in 3rd frame. The variables are wired through the second frame (using tunnels). The Invoke method node for re-initializing all values of the VI to default is placed in the 2nd frame. Like it? Drop a comment!

LabVIEW Tutorial - Tips and tricks I did not find elsewhere...

Greetings!

I'm sure you are in love with LabVIEW as I'm since using it for the first time in 2001. LabVIEW developers and consultants from all around the world have contributed with LabVIEW examples, tutorials, excerpts from their LabVIEW development, express VI and a host of other resources to the web. And the free LabVIEW Support & Help from National Instruments and their online forum is superb. Then why another blog on LabVIEW training?

The reason is, while I used the examples from other LabVIEW programmers & support from LabVIEW forum, there are certain things I learnt myself while faced with specific LabVIEW programming tasks. And I just thought it would be great to post it here so that other developers like you do not have to spend the time I did.

Also, I'm posting here a very simple LabVIEW tutorial that requires no programming background. Something that a 7th grader can understand and jumpstart with LabVIEW...

And yes, it goes without saying, I'll appreciate your comments and feed-back of your own LabVIEW programming experience. Feel free to contact me! Let us share our knowledge for mutual benefit.