LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Panel template, polymorphism, fitting etc. issues

Having written quite a few LabView applications, I wonder if anyone
(including, maybe, LV development team) can answer the following questions:

1. I have two programs with the same number (and matching type) of controls
on the front panel and slightly different diagrams. The _layout_ of the
controls on one panel is different from the layout on the other one (i.e.,
size, position, shown/hidden etc). I need to change the look of one control
panel as a whole to the look of the other one. How can I do that without the
tedious work of saving individual controls from one panel and applying them
to the other one, then repositioning etc.? Can a whole front panel be saved
as a single control with a possibility to apply it later to different VI's?

2. Is it possible to create a VI with polymorphism inputs/outputs? Why not?
When it will be (if it will)?

3. The nonlinear (Levenberg-Marquardt) fitting algorithm supplied with LV5.x
is based on the formula processing and looks nicer than the (unfortunate)
similar creation put in the previous versions. Nevertheless, it works at
least 10 times slower than the formula-node based predecessor. This is a
huge difference as far as any serious fitting is concerned. Just wondering -
is NI going to do anything about it?

4. How about 2-d nonlinear fitting algorithm (for the functions of more than
one variable)? Any plans to include it in the (pricey) advanced analysis
package?

4. Why low-levels read/write VI's for other than I16 and single precision
data types are not included? While using the I16 (or even the self-made
modified version I32) to read data, I always have some kind of aliasing
effect: few bits spikes in unpredictable locations. How come? IDL / Matlab
reads same data just fine.

5. Running a Save Characters to File VI in a loop with sequential saving of
data (adding characters to an external file) works well only if this VI
execution takes most of the loop time (i.e., LV is sitting on it and waiting
for completion). If data acquisition or some other processes are running in
the loop too (Win9x), the results of this data saving are generally
unpredictable. How do you go about that?

I looked through the postings, but did not find the answers. Maybe, someone
could help?

Michael
0 Kudos
Message 1 of 3
(2,644 Views)
My responses are marked with ***s.

> Having written quite a few LabView applications, I wonder if anyone
> (including, maybe, LV development team) can answer the following questions:
>
> 1. I have two programs with the same number (and matching type) of controls
> on the front panel and slightly different diagrams. The _layout_ of the
> controls on one panel is different from the layout on the other one (i.e.,
> size, position, shown/hidden etc). I need to change the look of one control
> panel as a whole to the look of the other one. How can I do that without the
> tedious work of saving individual controls from one panel and applying them
> to the other one, then repositioning etc.? Can a whole front panel be saved
> as a single control with a possibility to apply it later to different VI's?

*** You can't save VIs as controls, and LV doesn't yet support nested panels.
What you can do for appearance cases, like what you describe is to use strict
typedef controls. Any change to the control definition will propagate to
all uses of the control, like the two panels that you mention.

>
> 2. Is it possible to create a VI with polymorphism inputs/outputs? Why not?
> When it will be (if it will)?

*** LV is a compiled language, and thus the datatypes must be known and cannot
change once the VI is compiled. It is possible to use generic datatypes
like strings, which most other datatypes can be converted to, and then the
VI can retrieve the information from the string. This isn't polymorphism,
but it does allow for similar affects. Despite what I said earlier,
polymorphism isn't impossible in LV or in compiled languages. Up till now
we haven't figured out how we wanted to support it without making the diagram
really complicated. Perhaps it will show up pretty soon?

>
> 3. The nonlinear (Levenberg-Marquardt) fitting algorithm supplied with LV5.x
> is based on the formula processing and looks nicer than the (unfortunate)
> similar creation put in the previous versions. Nevertheless, it works at
> least 10 times slower than the formula-node based predecessor. This is a
> huge difference as far as any serious fitting is concerned. Just wondering -
> is NI going to do anything about it?
>
> 4. How about 2-d nonlinear fitting algorithm (for the functions of more than
> one variable)? Any plans to include it in the (pricey) advanced analysis
> package?
>

*** I'd suggest that you contact technical support about these issues.
This is
over my head.

> 4. Why low-levels read/write VI's for other than I16 and single precision
> data types are not included? While using the I16 (or even the self-made
> modified version I32) to read data, I always have some kind of aliasing
> effect: few bits spikes in unpredictable locations. How come? IDL / Matlab
> reads same data just fine.

*** The functions for I16, Dbl, and strings are included as high level
functions, and only support a fraction of the file I/O functionality.
If you opent the Advanced folder in the lower right of the File I/O
palette, you will find a general File Read that can be used to read
any sort of file along with seeks, flushes, etc. As to the problem you
are having with a particular file, you don't give much information to
go on. I'd suggest providing the data file and VIs to tech support
and let them help you with it. Many people use LV to read and write
files, and it does work if used in the correct manner.

>
> 5. Running a Save Characters to File VI in a loop with sequential saving of
> data (adding characters to an external file) works well only if this VI
> execution takes most of the loop time (i.e., LV is sitting on it and waiting
> for completion). If data acquisition or some other processes are running in
> the loop too (Win9x), the results of this data saving are generally
> unpredictable. How do you go about that?
>

*** Again, there isn't much to go on here. If you are using globals or
locals, there can be race conditions in the diagram that can cause all
sorts of problems that change as you try to debug them. If this sounds
familiar, the first thing to do is to try writing the diagram with fewer
locals/globals, and bone up on what race conditions are. Again, the high
level VIs aren't as efficient, they open and close the file each time.
You can get much faster results using the Advanced functions. If you
are having problems, contact support and provide them with VIs.

Greg McKaskle
0 Kudos
Message 2 of 3
(2,644 Views)
Michael Solonenko a �crit dans le message :
38bfeb57@newsgroups.ni.com...
> Having written quite a few LabView applications, I wonder if anyone
> (including, maybe, LV development team) can answer the following
questions:
>
> 1. I have two programs with the same number (and matching type) of
controls
> on the front panel and slightly different diagrams. The _layout_ of the
> controls on one panel is different from the layout on the other one (i.e.,
> size, position, shown/hidden etc). I need to change the look of one
control
> panel as a whole to the look of the other one. How can I do that without
the
> tedious work of saving individual controls from one panel and applying
them
> to the other one, then repositioning etc.? Can a whole front panel be
saved
> as a single control with a possibility to apply it later to different
VI's?

Can't you use a single VI with a case selector on the diagram to select wich
code to execute? When you finished modifications you save two copies and
arrange thing so that the proper code execute in each VI. You can do this
with a diagram constant, a front panel control (with different default
values) wired to the case selector, or select using VI's name. I know it
does not help you much now because you have to either copy the front panel
controls or the diagram (with subtantial rewiring to new controls). Choose
what is less tedious...

>
> 2. Is it possible to create a VI with polymorphism inputs/outputs? Why
not?
> When it will be (if it will)?

See Greg McKaskle's reply.

>
> 3. The nonlinear (Levenberg-Marquardt) fitting algorithm supplied with
LV5.x
> is based on the formula processing and looks nicer than the (unfortunate)
> similar creation put in the previous versions. Nevertheless, it works at
> least 10 times slower than the formula-node based predecessor. This is a
> huge difference as far as any serious fitting is concerned. Just
wondering -
> is NI going to do anything about it?
>

I do not know why you used "infortunate" for the previous version of the LM
fit.
I did not used it myself but I have noticed that having to edit "Target Fnc
& Deriv NonLin.vi" for each model is a serious inconvenience. However, you
can modify "Target..." in such a way that it calls by reference a model VI
that does the real computation work. Thus you fit another model passing a
new VI reference to "Target..." VI thru a global or other means. You won't
need to modify this "Target..." VI ever.
0 Kudos
Message 3 of 3
(2,644 Views)