LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import string programmatically to reentrant VI

Solved!
Go to solution

Thanks Ben, I really appreciate your help. I have attached a simple version of my project that you can use to test. You will need to run test.vi and change the value of the Language enum to import strings to interface.vi. Let me know if you find anything, and again, thanks for your help.

 

-Cristian

0 Kudos
Message 11 of 18
(1,992 Views)

Toosed the "hex 8" and only applied the mehtod when the VI is not running. See mod below.

 

Pay attention to the error messages. That is what gave me the clue to apply when not running.

 

Ben

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

Yes, I did note the error message returned. My ultimate goal is to be able to open multiple instances of the interface VI and import the strings to each instance.  Interface.vi is a reentrant VI set to preallocate clone for each instance, so I should be able to open multiple references to this VI and import strings to each one.

 

Refer to this modified test.vi

0 Kudos
Message 13 of 18
(1,979 Views)

Sorry but I will not be able to respond further until next Wednesday at the earliest.

 

You may want to start another thread and ref this one if nobody else replies.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 14 of 18
(1,966 Views)
Solution
Accepted by CAC10268

I can't really fill Ben's shoes, perhaps just the left one.  I would look into his very first suggestion of using a template.  You can't do this directly, as you pointed out, but with a little help from scripting you can create a new VI from the template and import the strings to it (with a little hack).  I think of it as manual reentrancy.  The hack is to modify the string file so the name inside matches the newly created VI.  To keep Untitled XX from appearing in the title bar, I give the FP a new title.

 

Not the way I would have thought to go about this.  That doesn't make it right or wrong, just different.  If/when you get it worked out I would be interested in trying it out to see how well it works.

Message 15 of 18
(1,955 Views)

Thanks Darin, I would have never thought of that. After some initial testing, it seems like this is exactly what I was looking for. I will keep you posted on how well it works once I integrate it into my application.

0 Kudos
Message 16 of 18
(1,952 Views)
Darin, quick question...what palette is the 'New VI' function under?
0 Kudos
Message 17 of 18
(1,944 Views)

You need to go to the LabVIEW APIs webpage and download scripting and follow the directions to activate it.  Just type Scripting into the search box at the very top of the page (to search ni.com, not the forum).  You may not ever write your own code using scripting (although I highly reccommend it), it does give you some extra properties and methods, and oftentimes an escape hatch when you need to workaround a problem.

 

BTW, the shoe is almost always (and by almost always I mean always) on the other foot, but Ben's initial suggestion of the template and later efforts were helpful, so you may want to "thank" him for it.

0 Kudos
Message 18 of 18
(1,939 Views)