LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

copy data between controls

I often find myself copying the contents of an array to another VI. It's fairly redious (right click on edge of array, data operations>Copy Data, paste in other array). I was hoping there was a programatica way to get this data to the clibpbard, but so far I've fallen short on figuring this out.

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 7
(3,474 Views)

@littlesphaeroid wrote:

I often find myself copying the contents of an array to another VI. It's fairly redious (right click on edge of array, data operations>Copy Data, paste in other array). I was hoping there was a programatica way to get this data to the clibpbard, but so far I've fallen short on figuring this out.


Do you need this operation during runtime of the two VIs? Why do not you use some cross-communication methods?

The scenario is not really clear to me. Anyway, you can also programmatically copy data to clipboard using Invoke Node called "Export data to Clipboard".

 

Hmm, interestingly I am able to paste these values from clipboard to notepad for example, but not into another empty array. I thought first this invoke node is identical to the "Copy data" option, but not....

 

Example_VIsssdd.png

 

 

 

 

0 Kudos
Message 2 of 7
(3,450 Views)

@littlesphaeroid wrote:

I often find myself copying the contents of an array to another VI. It's fairly redious (right click on edge of array, data operations>Copy Data, paste in other array). I was hoping there was a programatica way to get this data to the clibpbard, but so far I've fallen short on figuring this out.


I think you've found the best way to do this, but it is an odd scenario to find yourself in. Every once in a while I will want to save the data in a VI, so I will run once with an array indicator and then right click it and change to constant. If you are often needing the data in another VI, then the first VI should have that data as an output and the second should have it as an input.

0 Kudos
Message 3 of 7
(3,407 Views)

Thanks for the help. I do htis in order to run subVIs as standalones where I can't run the higher-level VI. I may have initialized some equipment and need ot copy an array of VISA over to a subVI to debig it. Running from the top level of the applicaiton isn't proactical when debugging, so I do this copy paste thing. i guess I was looking for a quicker way!

 

Thanks again!!!

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 4 of 7
(3,402 Views)

That's true, it can get complicated trying to debug one piece of equipment and not wanting to bother with other pieces of equipment / the rest of the program. Sometimes you only have access to the one piece of equipment you are trying to get working.

 

I use a couple design choices to minimize the pain. One thing you can do is wrap anything that communicates with an instrument in a "conditional disable" structure. Then, you can go to the project properties and set a new conditional disable variable. If I was working with an oscilloscope I might have the variable "Scope" and then cases for Scope==T and Scope==F.

 

Another thing I do is keep an instrument in its own loop, a separate process from the others. You can communicate with it any number of ways, queues, events, functional globals. I call this a "module". For each module you can have a tester VI that just sends messages to that piece of equipment. You can test out the functionality of your scope, or if Scope==F you can setup a random or simulated behavior.

Message 5 of 7
(3,395 Views)

There is also a VI property "Suspend when called". If you select this, it is going to pop up the VI when it is called. You can change inputs, and run it again. You can even manually change outputs before finally leaving the VI and going on with the rest of your code!

 

Suspend.PNG

 

 

0 Kudos
Message 6 of 7
(3,388 Views)

@Gregory wrote:

There is also a VI property "Suspend when called". If you select this, it is going to pop up the VI when it is called. You can change inputs, and run it again. You can even manually change outputs before finally leaving the VI and going on with the rest of your code!


The better place to set that flag is where the subVI is called.  Right-click on the subVI from the block diagram of the calling VI and select "SubVI Node Setup".  The suspend when called is an option in there.  This will make it on a per call basis instead of anywhere the subVI is called.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(3,368 Views)