From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labwindows to Labview programmming

Hi all,

I am LabWindows/CVI developer from past 2-3 years. Now i need to work on Labview to create test automation tools.

 

To make it Labview programming easy, can i compare or relate LabWindows i.e. Functions and variables etc. available in LabWindows. with LabView programming. It helps me to learn LabView quickly as i am already know LabWindows. 

Only thing i can easily compare is Labview is graphical programming language.

 

Regards,

Anand

0 Kudos
Message 1 of 14
(2,956 Views)

 

If anybody explain from development to building exe both in LabWindows and Labview perspective will be helpful.

 

Regards,

Anand

0 Kudos
Message 2 of 14
(2,952 Views)

Hi AnandR,

 

did you notice those "LabVIEW Training Resources" on top of the LabVIEW board?

Isn't this what you are asking for?

Best regards,
GerdW


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

Hi GerdW,

 

I checked now but couldn't find it. Can you please send me snapshot of what you are referring.

 

Regards,

Anand

0 Kudos
Message 4 of 14
(2,937 Views)

Hi AnandR,

 

I suggested this one:

check.png

Here you will find training lessons to learn LabVIEW!

A suggestion: forget about C programming (including variables) and learn to THINK DATAFLOW! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 14
(2,927 Views)

Hi GerdW,

 

Thanks for the suggestion.

When i tried writing basic vis, i could not get complete flow like in block diagram , references. local ,static, extern and global variable. So i thought to compare with labwindows.

Also i think in case of memory management , LabWindows and LabView are completely different.

 

Regards,

Anand

 

 

0 Kudos
Message 6 of 14
(2,923 Views)

Hi Anand,

 

Also i think in case of memory management , LabWindows and LabView are completely different.

That's why I wrote: Forget about C (=LabWindows) and learn to THINK DATAFLOW!

You will find an article about "DATAFLOW" in the LabVIEW help

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 14
(2,911 Views)

So, I know you are looking for a quick way to get started in LabVIEW.  It isn't going to be that easy... you are operating under the assumption that because both LabVIEW and LabWindows are produced by NI that they will be similar.  This is not the case!  They are completely independent languages with different design patterns / paradigms.  The only direct 1:1 correlation you might find is the use of daqmx drivers talking to hardware.

 

That having been said, don't despair!  In terms of learning, I think LabVIEW is one of the easiest languages to pick up.  There is no syntax to worry about, and the help files / documentation available is thorough and often has examples.

 

GerdW already pointed you in the right direction for getting started. In addition to his reading, I would like to emphasize a couple of points that hopefully will help your transition be easier.  These might seem counter-intuitive initially, but will help you build better code faster.

 

  1. Wires are your variables.  I can't stress this enough.  Your first inclination is going to be to declare your variables and types. Initialize them.  And then use local variables everywhere.  While this isn't necessarily "wrong", it leads to code that is very hard to follow, debug, and support.
  2. LabVIEW is a dataflow language.  GerdW mentioned this and linked a couple of whitepapers. For me this was one of the hardest concepts to pick up when I first started developing in LabVIEW.  What does this mean practically when comparing LabVIEW to CVI?  In LabVIEW, every bit of code that can execute will. Code will execute once all of the data required to do so has arrived.  This makes race conditions much easier to create, and ties back to point 1.  Over use of local variables causes race conditions.  Using wires as variables prevents race conditions.
  3. Avoid sequence structures.  Coming from CVI you will want to enforce execution order, and you will want your program to look nice, consistent and linear.  This can just as easily be done with wires (back to point 1, 2!) and doing so will make your code much, much easier to read.
  4. Use sub-vis regularly.  Even though each sub-vi is a separate file, think of them in terms of functions rather than files.  Each sub-vi is a written function that can be called elsewhere in your code.  Starting in LabVIEW it is easy to want to just create one block diagram with all of your code.  This makes the block diagram fairly large and difficult to follow.  Doing this is the LabVIEW world is the same as:
    void main()
    {
         entire program goes here
    }
    in the CVI world.  Not a good idea in CVI, and not a good idea in LabVIEW!
  5. Learn the event structure.  Again, one of your first inclinations will be to have a "polling" type application in LabVIEW.  Developing responsive GUIs with easy to follow and maintain code is much easier with the use of the event structure and perhaps a couple of standard design templates.  I'd also recommend reading this document completely and making sure you understand it before diving too deep into events.
  6. Learn the producer consumer design pattern and the state machine.  These two design patterns should cover the vast majority of your early LabVIEW applications.  While there are other more advanced designs available, I would suggest sticking to these two until you are comfortable working with them.

Good luck!  And don't hesitate to post any questions you have here as you are learning.  If you post code and request it, there are several people who will gladly go over it, make suggestions on improving it, and comment on what you have done correctly.

 

 

Message 8 of 14
(2,889 Views)

Hi BowenM,

 

Thanks a lot for the support in giving introduction.

 

Is there any tool available to convert Labview vi to .c source code. This for my understanding going forward.

 

Regards,

Anand

0 Kudos
Message 9 of 14
(2,883 Views)

Hi Anand,

 

Is there any tool available to convert Labview vi to .c source code. This for my understanding going forward.

There is a tool(kit).

But I guess you don't want to pay >10k$ just for "going forward"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 14
(2,880 Views)