LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I reference a control containing an array of strings from one project to another?

Hey guys

 

I have an array of strings containing names in Project A that I want to populate and save in project B. Once populated and saved, I want to be able to unbundle/read the strings in Project A.

 

I am having difficulty figuring out how to create and populate this. I have tried adding a reference in the control typedef, but I cant seem to use that reference in the other project. Could I please get some help?

 

Thanks heaps

 

Muri777_1-1623110498206.png

 

 

Muri777_0-1623110468978.png

 

0 Kudos
Message 1 of 8
(1,318 Views)

Please define the words "project", "save", etc.

 

Why would you even need B in order to read the strings in A?

 

It typically also help if you could attach your VI instead of pictures.

 

0 Kudos
Message 2 of 8
(1,299 Views)

Project A = projectA.lvproj

Project B = projectB.lvproj

 

For reasons, I need to keep the names.ctl in project A, and I need to be able to reference the names.ctl in project B, add elements to the array, save (make current values default) and access these in project A again.

0 Kudos
Message 3 of 8
(1,275 Views)

@Muri777 wrote:

Project A = projectA.lvproj

Project B = projectB.lvproj

 

For reasons, I need to keep the names.ctl in project A, and I need to be able to reference the names.ctl in project B, add elements to the array, save (make current values default) and access these in project A again.


This seems like "dangerous" programming to me.  What happens when project A get separated from project B?  It would be best to put the common files in a common library and make a distribution.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(1,245 Views)

If you want to communicate between two separate programs/projects, file or TCP/IP is the way.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 8
(1,241 Views)

---

0 Kudos
Message 6 of 8
(1,198 Views)

@Yamaeda wrote:

If you want to communicate between two separate programs/projects, file or TCP/IP is the way.


And VI Server, which under the hood uses TCP/IP too. It is even possible to use the original code as posted by the OP. The difference will be that you have to configure the "other" project to open a VI server instance on a well known (and unused TCP/IP port) and then using the Open Application node to connect to this VI server instance, then open a reference to the VI in question and from there find the control refnum on the front panel.

 

The question is if you should do that. It can make sense if you really intend to keep those applications separate but it is extra work, is slower as it needs to transfer potentially large amounts of data (arrays of strings can add up quickly to a lot of data) and only works if the other application is up and running.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 8
(1,161 Views)

Another idea: read these "constants" from a text file, that can easily be copied from one project to the other.

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 8 of 8
(1,156 Views)