LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with a RS232 LabView program

I'll suggest (like RavensFan (and probably everyone else)) that subVIs are great, and you should get working on them as soon as possible.

 

If you're currently unfamiliar/uncomfortable with them, there's no time like the present to change that.

 

If you're familiar with other programming languages, a subVI is just like a function. It has inputs and outputs (connector pane) and if you don't use references it generally works in a fairly straightforward manner.

 

Any time you find code that you're going to repeat, or want to call at a specific time or in a specific location, a subVI is probably a good choice.

Using the probe tool (and/or additional indicators) can help with debugging possible issues. Commonly, subVIs include error in/out controls and indicators which then allow both sequencing and checking the error behaviour.


GCentral
0 Kudos
Message 41 of 44
(328 Views)

@Torracc wrote:
For me it is way easier if I can see the compelte code the whole time. THis, I can try to follow everything and find a possible error and its solution.

That will very quickly lead to information overload and you won't be able to follow anything.  There is a reason engineering has more and more pushing for modularity: it is easier to see the overall picture when you don't have to worry about the minor details.  Conversely, it also makes it easier to concentrate on exact issues because you can focus on small parts of the application instead of navigating everything.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 42 of 44
(323 Views)

@Torracc wrote:

@crossrulz wrote:

You need to follow some previous advice and create subVIs.  You definitely want a VI just for sending a command.  You should also make one for each command you want to send.  This will help immensely in just organizing your code.  It would also be beneficial if you used a cluster for your status to even better organize it.


So for me as a beginner I find the use of SubVIs not so easy. For me it is way easier if I can see the compelte code the whole time. THis, I can try to follow everything and find a possible error and its solution. I get that the use of SubVIs is useful, but I struggle a little bit with them at the moment. Maybe later I can get used to them a little bit.


You might think that it makes easier to troubleshoot until you make a few subVIs and suddenly any errors you get are extremely localized and you no longer have to follow everything around. 

 

SubVIs are directly analogous to functions in a text-based programming language.  You wouldn't dump all your code into main(), right?  Same goes for LabVIEW.  You don't dump everything into one VI for all the same reasons as you wouldn't dump all your text code into main().

 

EDIT: Guess I'm a little late to the party.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 43 of 44
(302 Views)

@billko wrote:

SubVIs are directly analogous to functions in a text-based programming language.  You wouldn't dump all your code into main(), right?  Same goes for LabVIEW.  You don't dump everything into one VI for all the same reasons as you wouldn't dump all your text code into main().


And for some reason, you just reminded me of this story: The Dense Forest.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 44 of 44
(295 Views)