LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically add item to case statement

Is there a way to programatically add an item to a case statement within a labview exe file created using the application builder and then allow the exe to be saved with it's new case added? How do I programatically add a item to ANY labview case staement?
Thanks, Scott
0 Kudos
Message 1 of 5
(3,454 Views)
Hi,

This cannot be done in any language, not even in LabVIEW.

Regards,

Wiebe.

"Scott Davidson" wrote in message
news:506500000008000000CD6D0000-1031838699000@exchange.ni.com...
> Is there a way to programatically add an item to a case statement
> within a labview exe file created using the application builder and
> then allow the exe to be saved with it's new case added? How do I
> programatically add a item to ANY labview case staement?
> Thanks, Scott
Message 2 of 5
(3,454 Views)
No, you cannot add a frame, but you can achieve the equivalent effect with a
little bit of work.

1. If you COULD add a frame programatically, it would still use the case's
current input and output terminals for variables wired, yes?
2. So create a frame that is "Add-Ons", Default and inside use a "Call by
Reference" node, ie VIServer with strict VI type. You Create a template VI
that has the same control/indicator inputs and outputs as your case frame
and use the template to make new "frame" (plugin) VIs to handle the same
processing that you would have done with programmatic frames. Drop these
into a \PlugIns| subdirectory off your applications main directory.
3. At startup time you load all your "plugin" VIs into memory first, then in
your "Add-Ons", Default frame you lookup the correct "plugin" VI grab a
reference and run.
4. Better yet, when you load the plugin VIs get a VI reference to each and
store them all in an array in a shift register.

If you add the above to a state-table VI you can effectively create a
pseudo-infinite state-machine, since one of your standard frames can also be
a reload of new plug-ins, and an update to the state table.

Cheers,
Mike
****************************************************************
Michael C. Ashe Email: mashe@ctio.noao.edu
Sr. Scientific Programmer/LabVIEW, SOAR Telescope Project
SOAR
Casilla 603 P.O. Box 26732
La Serena 950 N. Cherry Avenue
Chile Tucson, AZ 85726-6732
Phone: +56-51-205341 +56-51-205200
Fax: +56-51-205368 +56-51-205212
Home Phone: +56-51-205267
Imaginatics Email: michael.ashe@imaginatics.net
****************************************************************
"Wiebe@AIR" wrote in message
news:3e1abec8$0$150$e4fe514c@dreader7.news.xs4all.nl...
> Hi,
>
> This cannot be done in any language, not even in LabVIEW.
>
> Regards,
>
> Wiebe.
>
> "Scott Davidson" wrote in message
> news:506500000008000000CD6D0000-1031838699000@exchange.ni.com...
> > Is there a way to programatically add an item to a case statement
> > within a labview exe file created using the application builder and
> > then allow the exe to be saved with it's new case added? How do I
> > programatically add a item to ANY labview case staement?
> > Thanks, Scott
>
>
0 Kudos
Message 3 of 5
(3,454 Views)
Hi,

There are, of course, lots of work around. I'll give your solution some
thought, but most of the applications don't need an add-on architecture...
I'd call this structure a sequencer. I've build some myself, but have not
jet created a 'formal architeture' (= fully documented) to facilitate it.

For a beginner, it might be easier to use teststand or test executive. But
programming it yourself is more fun, and more flexible (perhaps there is
someone willing to share an architectur like this)...

Regards,

Wiebe.


"Michael Ashe" wrote in message
news:3e1b3e67@newsgroups....
> No, you cannot add a frame, but you can achieve the equivalent effect with
a
> little bit of work.
>
> 1. If you COULD add a frame programatically, it would still use the case's
> current input and output terminals for variables wired, yes?
> 2. So create a frame that is "Add-Ons", Default and inside use a "Call by
> Reference" node, ie VIServer with strict VI type. You Create a template VI
> that has the same control/indicator inputs and outputs as your case frame
> and use the template to make new "frame" (plugin) VIs to handle the same
> processing that you would have done with programmatic frames. Drop these
> into a \PlugIns| subdirectory off your applications main directory.
> 3. At startup time you load all your "plugin" VIs into memory first, then
in
> your "Add-Ons", Default frame you lookup the correct "plugin" VI grab a
> reference and run.
> 4. Better yet, when you load the plugin VIs get a VI reference to each and
> store them all in an array in a shift register.
>
> If you add the above to a state-table VI you can effectively create a
> pseudo-infinite state-machine, since one of your standard frames can also
be
> a reload of new plug-ins, and an update to the state table.
>
> Cheers,
> Mike
> ****************************************************************
> Michael C. Ashe Email: mashe@ctio.noao.edu
> Sr. Scientific Programmer/LabVIEW, SOAR Telescope Project
> SOAR
> Casilla 603 P.O. Box 26732
> La Serena 950 N. Cherry Avenue
> Chile Tucson, AZ 85726-6732
> Phone: +56-51-205341 +56-51-205200
> Fax: +56-51-205368 +56-51-205212
> Home Phone: +56-51-205267
> Imaginatics Email: michael.ashe@imaginatics.net
> ****************************************************************
> "Wiebe@AIR" wrote in message
> news:3e1abec8$0$150$e4fe514c@dreader7.news.xs4all.nl...
> > Hi,
> >
> > This cannot be done in any language, not even in LabVIEW.
> >
> > Regards,
> >
> > Wiebe.
> >
> > "Scott Davidson" wrote in message
> > news:506500000008000000CD6D0000-1031838699000@exchange.ni.com...
> > > Is there a way to programatically add an item to a case statement
> > > within a labview exe file created using the application builder and
> > > then allow the exe to be saved with it's new case added? How do I
> > > programatically add a item to ANY labview case staement?
> > > Thanks, Scott
> >
> >
>
>
0 Kudos
Message 4 of 5
(3,454 Views)
ok, thank you all for your help.
Scott
0 Kudos
Message 5 of 5
(3,454 Views)