LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

'Labview for text based language programmers' articles/books/tutorials

Hi,

I'm quite new to LabView, but I have experience from other programming languages(C++, Java, Python etc).
I'm just wondering if there is some articles/books/turorials out there that would describe LabView for programmers
who have experience in text based programming languages. All the books I have been reading start describing
LabView for people who are new to programming.

Similar to when Java language first came, people wrote books like 'Java for C++ programmers' etc. I would like to learn
the LabView way of doing things that I know how to do with other languages.

If you know about such book/article/tutorial, please let me know.

Thanks.

Message Edited by kaêm on 10-03-2007 10:49 AM

0 Kudos
Message 1 of 4
(3,248 Views)
Hi there,
 
I also came from text-based languages to labview and the transition takes a little while. Probably the hardest thing for me to initially get my head around was the lack of traditional variables. The best way to learn labview is to practise it, but to get started, take a look at the Labview Bookshelf (under Help) and check out Getting Started with Labview. The concepts are easy, but it will show you the labview equivalent for many text based functions. Another great way to learn is to look at some examples in the Example Finder (also under help). Run these with Highlight Execution on (the little lightbulb at the top of the block diagram) and you can see exactly what is happening. A good resource if you are planning on working with labview for any period of time would be the LabVIEW Style Guide. Also if you want a tutorial that steps through developing basic labview applications there is one here that I read when I was first learning.
 
Hope this helps, and if you have any more questions, post them up on the forum, someone will gladly help you.
 
 
Jeff


Using Labview 7 Express
Message 2 of 4
(3,206 Views)

Adding to Jeff's comments;

Many of the contributors here and on LAVA are or were C-coders, so you have a lot of experience to call on.

Unfortunately I have not written that book (yet) and to the best of my knowledge, nor has anyone else.

What I can tell you (in the Reader's Digest version) is;

Stop Thinking in Steps!

It is a common mistake for C-coders to simply rotate their code 90 counter-clockwise and use sequence structures to define the order or the operations. Not only is this bad style, it also puts atrificial restrictions on LV. Think about what needs done and let LV determine the order.

Wire are Named Variables!

Another mistake C-coders make is again constructing LV code like it was C. In C you can read from a named variable and write the result back to that variable. The name of the varible was very helpful for me to keep track of what I was coding and were data was. LV will determine by itself what variables you need and will create and destroy them as indicated by the code.

 The variables are the wires!

If you really need labels to keep things straight, then put free lables over the wires to make you life easier.

Approach your application from the top down!

The operators of C were designed to be implemented on any machine hardware( almost). THe available machin language instructions were reduced to the basic operations required to accomplish any task. LV has done the same thing but from the other direction, i.e. insteed of looking at the machine code, it was designed from the view point of the "Human code".

Keep your code modular!

When coding I find it best to concentrate only on the current task at hand. When I coded in C, I had to think about getting back to other tasks that I had started to make sure they are progressing properly then jumping back to the task at hand. This is a natural response to the single thread nature of a text based launguage (yes I known more thatn LV cand do multithreading). Since LV handles all the scheduling I don't have to thenk about other things but can dwell on the challenge before me. The extent of the thought is limited to making sure I don't use up all of the CPU and I leave some for other processes to use.

Globals Are Evil!

The multithreading aspect of LV allows for race conditions if protected sections of code are not protected. Many ex-C programmers will use Global varibles they way they are used in C. At best they can serves global define statements. There are better methods of sharing information across threads. Learn what Action Engines are and use them, queues or other mechanisms to share info.

Ask Questions!

LV has acquired a group of nut-cases (like myself) that love LV so much that they want others to learn to love it as well. Let us advise you when you run into a challenge.

Answer Questions!

Once you get a handle on LV take the next step and try answering any question you think you know the answer to. If you get it correct, you will have re-inforced your knowledge and you may even get some stars or nice comments from the experts. If you get it wrong, someone will generally step in to correct you and set the record straight.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 4
(3,188 Views)
Thank you Jeff and Ben for the great tips, this helps me a lot.
I'll keep on asking questions in the forum(, and try to answer to
some)

And Ben, if you're really considering to write a book on how to
make the transition from 'traditional' programming languages
to LabView, I think there would be an audience for that.
0 Kudos
Message 4 of 4
(3,129 Views)