From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copying Multicolumn listbox data between two EXE instances of the same VI

Hi!

 

So I have a VI that is using some multicolumn listbox controls. I created EXE from that VI and enabled multiple exe instances like described here: http://digital.ni.com/public.nsf/allkb/AB268878693EF4B586257037004A6725

 

What would be the best way so I could copy content of multicolumn listbox controls from one isntance to another. I tried simple drag and drop and it does not work. Is there some kind of trick as how to implement copy paste so the data are available to all instances of the same exe?

0 Kudos
Message 1 of 5
(3,117 Views)

You mean manually? 

You can copy single elements by selection "data operations->copy/paste" from the context menu but you can't copy at items at once.

 

Programatically you can create a wrapper vi which obtains a data value reference to a two dim string array and pass this reference to the instaces when you start them by "call by reference". however if you manually start the .exe several times you cannot pass in data value refs.

Using the reference you can update the listbox from one vi in another vi.

 

0 Kudos
Message 2 of 5
(3,045 Views)

Let me ask you a simpler question. Let say I manually start three instances of the same EXE. Can you programmatically differentiete different instances? I understand that you can copy simple text from one control to another. But can you program labview in such a way that you can copy 2D array string from one instance of EXE to another...by manually programming Copy/paste commands?

 

Well simple solution would be to actually export data in a file from one instance and import data from a file to another instance. That would work and if no othere way this will be one of the accaptable solutions. I was thinking in a way that there would be no neccesetiy for a file. Kind of like if you have opened there excel instances and you can copy tables between them.

0 Kudos
Message 3 of 5
(3,033 Views)

A simple solution would be to use a shared buffer. Put buttons "copy" and "paste" onto the FP. Configure an event structure on the value change events of these buttons. Withing the event frames either copy data from the object names property node of the multi column listbox into the buffer or read the buffer and pass the data to the object names property node.

 

Anyway, these three bullet points you should get to know:

- Data value references (found in application control -> memory)

- Queues (found in synchronisation -> queues)

- Reference counting 

 

 

0 Kudos
Message 4 of 5
(3,011 Views)

Here is a version using the standard clipboard of windows.

As i could figure out, different .exe instances use different processes and all the references labview can handle or only valid inside one process. Therefore queues or data value refs cannot be used to store the temporary data. However, the clipboard can.

You just have to convert the 2d string data of the listbox into a table string and vice versa before putting or after getting the data to/from the clipboard.

Thats it.

 

The attached zip files contain the sources as well as a build .exe, configured to run one or more times.

Download All
0 Kudos
Message 5 of 5
(2,989 Views)