LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OK, so I'm new to this...

I came here from C, and it's not fun, believe me. I'd like to start off with 3 questions:-

1. Why does a vi behave differently when I call it from another vi than when I run it separately? If that's a bit vague, I'll post an example. Basically it seems that a loop will call the vi continuously, instead of waiting for it to finish. I do realise that this probably a typical newbie question, but we've all gotta learn.

2. When I construct a sub-vi from the menu, the ref's have little stars on them that appear to relate to 'strictly-typed' components. I can't work out how to generate these manually. And what's the difference anyway?

3. I don't suppose there's an easy way to 'comment out' code is there?

And an observation:


In CVI there's a great tool for arranging the panel nicely. You just select all the relevant controls, hit and dictate that they are all the same width, position etc. I can't see why this isn't in LV, or have I missed it?
0 Kudos
Message 1 of 2
(2,539 Views)
> I came here from C, and it's not fun, believe me. I'd like to start
> off with 3 questions:-
>
> 1. Why does a vi behave differently when I call it from another vi
> than when I run it separately? If that's a bit vague, I'll post an
> example. Basically it seems that a loop will call the vi
> continuously, instead of waiting for it to finish. I do realise that
> this probably a typical newbie question, but we've all gotta learn.
>
> 2. When I construct a sub-vi from the menu, the ref's have
> little stars on them that appear to relate to 'strictly-typed'
> components. I can't work out how to generate these manually. And
> what's the difference anyway?
>
> 3. I don't suppose there's an easy way to 'comment out' code is
> there?
>
> And an observation:
>
> In CVI there's a great tool for arranging the panel nicely. You just
> select all the relevant controls, hit and dictate that
> they are all the same width, position etc. I can't see why this isn't
> in LV, or have I missed it?
>

1. The differences may be due to unwired inputs. When run
interactively, you enter values into various controls, the VI runs, and
the indicators show the results. When called from a VI, the wired input
are sent to the subVI controls, unwired inputs are set to their default
values, then the VI is executed and indicators updated. Another
possibility is that the VI isn't a function. Its output could be based
on a piece of external HW, external file, or a historical value stored
in a control or a shift register.

2. The difference is subtle and not that important unless the value
property is being used. A numeric class reference specifies the
properties and methods of the reference as numeric. A general
non-strict numeric reference to an integer and a float is identical.
The value property has datatype of a variant. A strict reference, with
the star, includes the more strict numeric information about the value.
This means that the strict reference to an int and a float are not
equivalent. To change the reference, popup on it and change the bottom
menu item which indicates whether to include data type.

3. Not at this time. At times you may want to surround the code with a
case statement, wire a Boolean constant to ensure that the diagram code
isn't run. One thing this will make obvious is the outputs, the
dataflow dependencies that need output data values. This will not work
for VIs that are currently broken, but it works well to skip blocks of code.

4. We don't have a tool for doing this yet. There is feedback in the
tip strip that gives the size, and you can use align and distribute menu
buttons to arrange the controls on the panel.

Greg McKaskle
0 Kudos
Message 2 of 2
(2,539 Views)