LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reopen a same vi ?

Hello,

I'd like to re-open a vi that draw one sort of graph several times (in fact,
every time the user select "Graph" in the menu). How can I do ?
I've tested to modify the Vi's options (re-entrance execution) and to set
the option of the OpenVIReference to 8, but it still doesn't working ! Why ?

Thanks and sorry for bad english !
Amandine

(I use Labview 7.1)
0 Kudos
Message 1 of 8
(3,632 Views)
I think the best way to do this would be to save the VI you want to open multiple time as a VI template (.vit).

Then when you open a reference to the template and open the front panel, the template gets renamed with a sequencial number, and it changes to a .vi, just as if you had opened the template from the File>New... menu selection.

So each time you open a reference and the front panel of that reference, you get a uniquely named VI with its own memory space.

One thing to remember is that these spawned VIs will not be saved, they exsist only in memory. So if you want to save them, you will have to do it manually through menu or use 'Save Instrument' invoke node.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 8
(3,632 Views)
That seems to be exactly what I want... but ...
sometimes, I've got the error 1127 : instance already in memory
(approximative translation !! I'm french...),
and sometimes, it opens only one time the front panel !!
Could you take a look on my vi and tell me what is the problem ?
Thanks

Amandine

"Ed Dickens" a écrit dans le message de news:
506500000005000000678C0100-1079395200000@exchange.ni.com...
> I think the best way to do this would be to save the VI you want to
> open multiple time as a VI template (.vit).
>
> Then when you open a reference to the template and open the front
> panel, the template gets renamed with a sequencial number, and it
> changes to a .vi, just as if you had opened the template from the
> File>New... menu selectio
n.
>
> So each time you open a reference and the front panel of that
> reference, you get a uniquely named VI with its own memory space.
>
> One thing to remember is that these spawned VIs will not be saved,
> they exsist only in memory. So if you want to save them, you will have
> to do it manually through menu or use 'Save Instrument' invoke node.
>
> Ed
0 Kudos
Message 3 of 8
(3,632 Views)
Sure, just zip up all the VIs and templates and attach it to a message here. That way, more than just me can look at it.


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 8
(3,632 Views)
It is just that the template VI must not be in memory when you want to instanciate it. Make sure that the template is closed before running a new instance.


LabVIEW, C'est LabVIEW

0 Kudos
Message 5 of 8
(3,632 Views)
Français ? ça serait plus simple...
en fait, ça ne marche toujours pas ! je ne peux pas fermer la référence tant
que le VI s'affiche, non ?

"Jean-Pierre Drolet" a écrit dans le message de news:
506500000005000000928C0100-1079395200000@exchange.ni.com...
> It is just that the template VI must not be in memory when you want to
> instanciate it. Make sure that the template is closed before running a
> new instance.
0 Kudos
Message 6 of 8
(3,632 Views)
Bonjour tout le monde,

Réouvrir une face d'un même Sous-VI plusieurs fois n'est pas possible.
En effet, pour réouvrir une face avant il faut d'abord la refermer.

Sanaa TAZI
0 Kudos
Message 7 of 8
(3,632 Views)
Québécois.
Quand le template VIT (avec l'extension VIT, pas une instance Template N.vi)est en mémoire et que tu ouvres une référence au template, tu ne crées pas une nouvelle instance. Tu ouvres simplement une nouvelle référence au template. C'est pourquoi tu ne le vois s'ouvrir qu'une seule fois.

Une fois que ton VI appelant a ouvert une référence, ouvert la face avant et lancé le VIT, il peut fermer la référence; le VIT va continuer de tourner.

Il ne faut pas que le VIT soit en mémoire pour créer différentes instances. C'est à dire que la face avant est fermée et que toutes les références sont fermées.
Lorsque tu ouvres une référence alors que le template n'est pas en mémoire, alors une nouvelle instance
et une nouvelle face avant est créée à chaque référence que tu ouvres.

Donc si tu viens d'éditer ton template, tu fermes la face avant avant de lancer ton VI Top Level. Le VIT va aussi rester en mémoire lorsqu'il est copié sur le clipboard ou sur le diagramme d'un VI appelant.


LabVIEW, C'est LabVIEW

0 Kudos
Message 8 of 8
(3,632 Views)