LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Naming Convention for LabVIEW

Solved!
Go to solution

Hello,

What kind of naming convention should be followed in LabVIEW? Shall I use typical CamelCase (MyNewProgram.vi) or with underscore (My_New_Program.vi) or with spaces (My New Program.vi)? In most of the standard LabVIEW programs I have observed that namings are with spaces (My New Program.vi) but most of the text language programmers prefer without spaces convention. Which is the best way to name VI or variable in LabVIEW and what is the reason for that?

 

I went through the guidelines and different post but they just mention not to use special character. Nowhere I found the standard convention of naming in LabVIEW.

 

Kindly guide.

 

Thanks.

0 Kudos
Message 1 of 6
(1,732 Views)

Hi eBuddy,

 

In LabVIEW environment it's define as My New Program.vi, take a look at the LabVIEW functions palette. Me I use MyNewProgram.vi as a diagram must stay smaller than a screen size, the smaller your label are the better.

 

Regards.

 
Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 2 of 6
(1,723 Views)

Thank you sabri.jatlaoui for the answer.

 

Yes LabVIEW standard functions uses name with spaces but what is the reason other programming language defines NoSpace naming as standard practice and what makes LabVIEW different from other languages to use spaces. I am working with another team who uses NoSpace convention and I am forced to use NoSpace. I want to explain to them which convention gives advantage in LabVIEW. As standard LabVIEW uses spaces there must be a reason.

0 Kudos
Message 3 of 6
(1,715 Views)

In some languages he space is the end of the string. So if you have 2 words in you function name and you put a space between them it can be understood as 2 different elements.

Not In LabVIEW. You can find some naming convention here http://www.ni.com/white-paper/5560/en/#toc5. But as I said earlier MyNewCode.vi could be a good choice to minimize use space in your diagram.

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
Message 4 of 6
(1,704 Views)
Solution
Accepted by topic author eBuddy
04-25-2016 03:49 AM

The Camel Case originated from the DOS days when you were only allowed 8 characters to a file name.  Windows allows spaces in file names.  Linux does not.  Due to the Linux/Unix limitation, you will often see text language programmers use the underscore.  Almost all of my code is on Windows, so I use spaces in my file names simply because I find it easier to read than with the underscores.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 5 of 6
(1,685 Views)

You are incorrect.

Linux allows spaces in file names. Has got a plenty of them on my drive, some with creation date year 2007 (year when I switched to linux).

 

The reserved characters on NTFS (still very spread in windows systems, introduced 1993 with windows NT) are:

0x00-0x1F 0x7F " * / : < > ? \ |

 

The ext2 filesystem, introduced in 1993 with linux, has only two following reserved characters:

0x00 '

Message 6 of 6
(1,366 Views)