04-16-2008 03:25 AM
Hi all,
I am developing an application which will create multiple VI instance from Template VI.
what’s my problem is tracking the instance VI.
How to maintain the reference number of the VI?
Upon next iteration, i want to check the VI whether it is running / completed / closed.
Based on that, i will do certain operation.
For example :
Engine refnum
1 987845
2 457854
3 215645
.
.
.
Waiting for yours reply
Thanks
Ram
using Labview 8.5 , GOOP 3.0
04-16-2008 04:36 AM
04-16-2008 05:10 AM - edited 04-16-2008 05:15 AM
Actually that is a bit misleading I think. The instantiation of the Template VI happens at the Open VI Reference node when the correct options bits (bit2 is not set) are passed to it. The refnum that is returned from this Open Vi Reference Node is the refnum the OP would like to have. You also need to keep this refnum valid since it is the only thing that would keep the VI instance alive and is also the means to reference that VI instance later on. So storing that refnum in some way (and making sure the VI hierarchy that executed the Open VI Reference stays running for the entire life time of that VI instance) is the way to do what was required. Of course I would use for that stoarge an intelligent LabVIEw 2 style global or as some like to call it an action engine. But a global (autsch I really used that word) array of VI references would work too as poor mans solution.
@JB wrote:
Use an Invoke Node to call the template VI dynamically and you will get the reference of the instance. The code is shown in this document.
04-16-2008 05:22 AM
04-16-2008 10:10 AM
04-18-2008 06:27 AM
Hi,
Since you are using GOOP3, i.e. object oriented programming, you can simply store the VI refs as data (attribute) in the class. Using a class gives you a natural place for putting the code that launches and manages the VIs, it can be placed in method VIs of the class.
Jan Klasson
www.endevo.se
04-23-2008 03:25 AM
hi jank,
can you tell me which data type should I use to store the reference number ?
Thanks
Ram
04-28-2008 03:50 AM
05-02-2008 07:10 AM
05-02-2008 08:40 AM