LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can LabVIEW variables be used like those found in a Java program?

Solved!
Go to solution

I created a decoding program in Java that reads in a certain number, or code, and returns the decoded version of that number.

 

I tried initially to create this program inside of LabVIEW itself but was hindered by my lack of familiarity and knowledge of what LabVIEW can and can't do and how to approach the problem in LabVIEW.

 

My stumbling blocks in LabVIEW seem to be the arrays and working the variables. I'm probably approaching this completely wrong, more than likely because I'm trying to think in Java rather than LabVIEW. 

 

Any help that can be given is most appreciated. Also I have attached a text document with my Java code in it. It's not perfect but it works.

 

If I need to clarify anything just ask.

 

Once again thanks for any help in advanced.

0 Kudos
Message 1 of 4
(2,605 Views)

LabVIEW doesn't have variables in the same manner you may be thinking of in text based languages.  The wires contain the data.  And if you need to update a data value (such as incrementing a counter) and use the new value at the beginning of the next iteration of your while loop, you use shift registers.

 

Arrays in LabVIEW are also a basic concept.

 

I would recommend you start by looking at some online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

Message 2 of 4
(2,575 Views)
Solution
Accepted by topic author Crushed

In LabVIEW the wire is the variable. The way you pass parameters to functions (subvis) is with a wire through the connector pane. Same for returning results.

 

Forget that local variables exist! A lot of new programmers that come from a text based programming background discover the LabVIEW local and global variables way too early. Like duct tape they can be useful. But it is possible to write huge complex applications without touching them. And the code is much simpler than programs of less complexity that make extensive use of locals and globals.

 

Since you are new to LabVIEW you can become a very good programmer if you keep the following in mind. It is a little confusing but "local variables" and "global variables" are not really variables in labVIEW like they are in Java. The wires are the variables. Those rectangle things you create from controls or indicators are more like a function for that control or indicator. They can not exist without an owning control or indicator. It is unfortunate that they are called variables but they are a relic of the stone ages when code was carved into cave walls.

=====================
LabVIEW 2012


Message 3 of 4
(2,559 Views)

Thanks!

0 Kudos
Message 4 of 4
(2,511 Views)