LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy LABVIEW array or cluster data to the Windows clipboard

Is it possible, while a VI is running, to copy the entire data contents (not the bitmap, as happens when the 'copy' option is used) of an array or cluster, onto the windows clipboard such that it can be pasted into other applications like for instance Excel?
0 Kudos
Message 1 of 12
(9,126 Views)
Attached is a NI VI for copying contents of a string file. You can easily alter it to your array or cluster by linking the properties to that item's name.
If you run this VI, and type data in the string field, you can then Cntrl-V/paste and see your string has been copied.
Good luck with it, Doug
0 Kudos
Message 2 of 12
(9,126 Views)
I should have attached this before - its in case you need the library files too for the SimulateKeyboard.vi
0 Kudos
Message 3 of 12
(9,126 Views)
Thanks Doug, I found this useful. It did not solve my problem hoewever. The problem is that I can't select the data-contents of a whole or sub-array or cluster before copying it to the clipboard. LabVIEW only allows copying one element at the time for some reason. Do you have a solution for that?
Much obliged, Peter
0 Kudos
Message 4 of 12
(9,126 Views)
It seems there must be a way to index all the values (start - end) and Copy. Perhaps you could convert the array to a string, and Copy that string.
0 Kudos
Message 5 of 12
(9,126 Views)
I have posted a derivitive of your code, Doug, that works on numeric arrays.

-Jim
Message 7 of 12
(9,126 Views)
This code can handle 1-D or 2-D arrays. Also it allows you to chose whether you want a column or a row (\n or \t delimeter). The data will paste into Excel as a column or a row, respectively. It also allows you to to choose how many digits of precision you want. It is a modification of Doug's code. Note that you may have to change the VI Properties to "show front panel when called", and "close afterwards if initially closed" for it to work as a SubVI(I have not tested this theory).
Message 6 of 12
(9,126 Views)
That's great, Jim (and Doug!). Much obliged. This will boost my LabVIEW applications where data need to be tranferred to MS-Office applications.
0 Kudos
Message 8 of 12
(9,126 Views)
Looks good Jim - I'll replace my old version with your version, thanks. D.
0 Kudos
Message 9 of 12
(9,126 Views)

Guys,

    what am I doing wrong?  I am trying to use the copytext.vi listed above as a sub-vi to copy  waveform data from my oscilloscope (after turning it into a 2d array) to the clipboard, but no dice- the clipboard is unchanged.  Any suggestions for obvious stuff to check? 

0 Kudos
Message 10 of 12
(8,681 Views)