LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import string programmatically to reentrant VI

Solved!
Go to solution

I am working on a multi-language application that includes a reentrant VI. I have been successful at importing a strings file to non-reentrant VIs but seem to have issues importing strings to a reentrant VI. I basically call the reentrant VI dynamically in a loop (open VI ref, import strings file, run VI). The first iteration is error free, but after that it returns error code 1000.

 

I know that the import strings function does not execute when the VI is running and that is why I am receiving this error, but my VI is reentrant and set to preallocate clone for each instance. Is this behavior expected when using the import strings function while calling a reentrant VI multiple times? If so, is there a workaround this issue?

 

Thanks,

Cristian

(Using LabVIEW 9.0f2)

0 Kudos
Message 1 of 18
(5,282 Views)

Try using a template (*.vit) instead. I believe all re-entrant VI's share the FP.

 

I admit I have not tried this.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 18
(5,278 Views)
I have actually attempted to use a template VI prior to posting my question.  The import strings function always returned an error when using a VIT so I shifted over to trying a reentrant vi.
0 Kudos
Message 3 of 18
(5,274 Views)

Ben wrote:

 "...I believe all re-entrant VI's share the FP...."


If this is true, then I should be able to just import strings on the first iteration of my loop and the strings should change for all of them.

 

I made a simple VI of this for testing and found that on the second iteration, the Run VI method returns error code 1000. The loop runs correctly on the first iteration because the reentrant VI was not in memory, but on the second iteration, it seems like when a new reference is made to the reentrant VI, it sees that it is already running in memory.

 

From what I understand about reentrant VIs (set to preallocate clone for each instance), they should act very similar to VIT's. Someone correct me if I am wrong.

 

reentrantvi.png

0 Kudos
Message 4 of 18
(5,249 Views)

I believe the Open VI ref accepts an optional input of a hex "08" (check the help) to indicate the VI should be opened as reentrant?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 18
(5,227 Views)

When I add the hex '08' input to the Open VI Ref function, I get error code 1000 following the import strings function. It almost seems like the import strings feature is not available for either VIT's or reentrant VI's. Can someone verify that this is correct?

0 Kudos
Message 6 of 18
(5,219 Views)

I am still unable to solve this issue with importing strings to reentrant VI's. If someone could please assist me in solving this issue or finding a workaround, I would greatly appreciate it!

 

Thanks,

Cristian

0 Kudos
Message 7 of 18
(5,190 Views)

This is not a an often used feature so I'mnot sure many have done this. I did have one other idea.

 

Try opening all and import the strings for each before running any of them. This idea is spwaned from the theory that once running the method is invalid.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 18
(5,187 Views)
The problem that I am running into is that anytime I use the Import Strings method with a VIT or a reentrant VI (and wiring an 8 hex value to the Open VI Ref function), I receive an error even if the VI is not running yet.
0 Kudos
Message 9 of 18
(5,170 Views)

If you are wiling to post a complete zip, ready to go, I'll take a look when I get into work in the morning.

 

AS I said earlier I have nver done that and never heard of anyone doing it but I am willing to take a look if you post everything I need.

 

No guarentees aside from trying it myself in the AM.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 18
(5,166 Views)