LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Struggling with running different instances of same VI

Hi,

 

I need to be able to load several copies of the same VI and have them each maintain their state throughout the execution of a main loop in which they all reside. I initially thought using dynamic re-entrant exectution was the way to do it but as I am running these on a RT target, I get this error:

 

 


 

 

Error 7 occurred at Open VI Reference in Generate_Channel_Monitor_Occurance_Array.vi->Initialize_Charger_Monitor_For_cFP2200.vi->Charger_Monitor_for_cFP2200.vi
Possible reason(s):
LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS X, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
VI Path: /c/ni-rt/startup/Channel_Monitor.vi
LabVIEW Real-Time: VIs built into executables cannot be accessed through VI Server calls. Use Source Distributions to dynamically call VIs on Real-Time targets.
Error 7 occurred at Open VI Reference in Generate_Channel_Monitor_Occurance_Array.vi->Initialize_Charger_Monitor_For_cFP2200.vi->Charger_Monitor_for_cFP2200.vi
Possible reason(s):
LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS X, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
VI Path: /c/ni-rt/startup/Channel_Monitor.vi
LabVIEW Real-Time: VIs built into executables cannot be accessed through VI Server calls. Use Source Distributions to dynamically call VIs on Real-Time targets.

 

 

 


 

In doing some reading, I discovered that error is due to the new way files are stored on RT targets. Is there a way to call multiple instances of the same non-looping VI and have it maintain the same state for each, throughout the loop cycles without doing so dynamically?

0 Kudos
Message 1 of 9
(3,561 Views)

1. Have you proven that it works on Windows? Do that first.

 

2. Seems like one of the OS's might require your path to use lower-case c: instead of upper case C: Could that be it?

 

 

0 Kudos
Message 2 of 9
(3,546 Views)

Error 7 is as it says: File not found.

Is /c/ni-rt/startup/Channel_Monitor.vi correct?

 

Are you trying to start your multiple VIs through VI server? According to the error message it looks like you're trying to.

 

I'm not quite clear on your problem. A reentrant VI will maintain it's state through it's execution, but reset the next time it's called. You can circumvent this be feeding it from your main loop and keep the information in a shift register.

 

This shift register can either be in the main program or as an Action engine. As an AE per definition cannot be reentrant it'll have to be an array of the information (probably in the form of a cluster). That way the other VI's can extract their part.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 9
(3,541 Views)

I think this little message points to your problem:


VI Path: /c/ni-rt/startup/Channel_Monitor.vi
LabVIEW Real-Time: VIs built into executables cannot be accessed through VI Server calls. Use Source Distributions to dynamically call VIs on Real-Time targets.


How are you getting the 'name/path' for the VI to be called? I wouldn't rely on the vi-path, but better the vi-name.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 9
(3,538 Views)

Yamaeda,

 

Are you saying a non-looping re-entrant VI would not maintain the state of its own feedback nodes? The SubVIs I want to load multiple instances of have several feedback nodes each. I thought this was the reason one would use re-entrant VIs.

0 Kudos
Message 5 of 9
(3,536 Views)

I was just feeding it a relative path.

0 Kudos
Message 6 of 9
(3,534 Views)

I'm going to start another thread as I realize this may be confusing as I didn't explain what I'm trying to do when I ran into this problem very well. Maybe by giving such an explanation, I can get more targeted advice.

 

Thanks if you already tried to answer.

0 Kudos
Message 7 of 9
(3,521 Views)

If it's relative to the .exe i can bet on that it has lost a path level when compiled. 🙂

 

Unless Altenback slaps me on my fingers, reentrant VI's creates a new copy each time they're called, as such there's no use keeping memory in them ... Just checked help, the Share memory reentrancy behaves as i said, what you want is Preallocate clone.

 

"Select the Preallocate clone for each instance option if you want to create a clone VI for each call to the reentrant VI before LabVIEW calls the reentrant VI, or if a clone VI must preserve state information across calls. For example, if a reentrant VI contains an uninitialized shift register or a local variable, property, or method that contains values that must remain for future calls to the clone VI, select the Preallocate clone for each instance option."

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 9
(3,519 Views)

I think that could be what happened - meaning I would ultimately have to put the source code on the device to get it to work. I know I can't do that since this device will be deployed to customer sites and it won't be a clean install. I'm starting a new thread with the goal of describing what I'm trying to do rather than focusing on the error I'm getting. Maybe I'm just approaching the whole thing wrong.

0 Kudos
Message 9 of 9
(3,513 Views)