Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

LabVIEW

 
webmaster forum
madness  Offline
Activity
0%
 
New Coder
Location: Austin TX
Gender: Female
Posts: 26
Topics: 2
December 10, 2008, 09:45:24 AM

Any LabVIEW users around here?  It's a great resource for someone like me who writes programs simply to control experiments in the lab instead of writing programs for other end-users.  It can be a frustrating language to get used to after writing lines of code for so many years.  Here's an example of the "G" language that LabVIEW uses in case you've never seen it:



Not the prettiest bit of code I've written in LV, but just something I had sitting on my desk top - it's an older version of an image analysis program for a gravity experiment we are performing.
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
December 10, 2008, 10:02:23 AM

Nice - I have never even heard of LabVIEW until this post! It looks like it has an interesting programming interface, are you "stuck" writing systems in that graphical way, or can you write underlying code in it? Whats the perfomance like?

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
madness  Offline
Activity
0%
 
New Coder
Location: Austin TX
Gender: Female
Posts: 26
Topics: 2
December 10, 2008, 01:06:33 PM

That's just what I thought when I first started using it - I was "stuck" using the wiring diagram!  But now I really do like it.  Very intuitive.  It would probably be even easier for a person who has not programmed before since they won't have preconceived notions of linear blocks of code.  There is no way to edit the underlying code as this IS the code.  The compiler takes the parse tree you've drawn and generates native instructions for the PC.  Took some getting used to - other GUI things I've used allow you to still see the "real" code.  Like using Dreamweaver to make a webpage - you can still access the actual HTML.  But with LV, that picture really is all you've got!

You can write code inside "formula nodes".  For a complicated mathematical expression, it's pretty impractical to use the G code (for example, you can see some multiply and divide triangles in the above code).  So it's much easier to use code as follows:



Inputs are on the left, outputs on the right.  But this code actually executes SLOWER than if you drew out the complicated wiring diagram.  That's just about my only beef with the performance.  Other than that, it's just right for the type of stuff we do here.  The program is constantly changing as the experiment evolves.  And it has all sorts of bells and whistles built in for the actual interface you use when running the program - graphs, switches, lights, etc. 
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
December 10, 2008, 02:39:52 PM

Fascinating. My PhD is in programming language design (for HPC). Its really interesting to see such a different approach to programming. I was discussing quite a while ago the idea of whether programmers should have an "interface" (other than their code) to the compiler, so as to provide extra information - it seems that LV has this at an extreme level.

On another note, you mentioned it might be easier to use initially if you didn't have that programming background.... do some people who use it not really realise that they are programming?
« Last Edit: December 10, 2008, 02:45:55 PM by polas »

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
madness  Offline
Activity
0%
 
New Coder
Location: Austin TX
Gender: Female
Posts: 26
Topics: 2
December 10, 2008, 02:56:52 PM

No I don't think people don't know that are programming.  It's just that it was hard to get used to the very non-linear nature of things.  You can have many bits of code all executing essentially at the same time if you don't put things in a sequence block.  It's not like other languages where the program starts at line 1 and proceeds froward.  Plenty of times I've been stuck only to find out something was happening "out of sequence" because LV just starts anywhere and goes unless you are REALLY specific about it.

In the first shot I posted, the program would be executing all of the parts that don't have wires connecting them at the same time.  Only the parts in what look like film strips are done "in order".  Otherwise, LV just picks and chooses willy nilly what parts to compile when.  So the instructions can end up jumbled and of course buggy when executed.  Doesn't matter a lot of the time, but can be a thorn in your side other times!
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
December 11, 2008, 06:01:49 AM

Ah right, i see what you mean. It sounds like that the "language" quite nicely results in different blocks which, if the creators wanted, could be run parallely (if it supports it.)

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 03, 2012, 09:33:50 PM