LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy/Pasting Data straight into LabVIEW, without loading a file.

Solved!
Go to solution

Hey all,

 

I would guess that someone's already thought of this, but I just whipped it up so I thought I'd share. Say I've got 2D floating point data in Excel that I want to bring into LabVIEW. Normally, I would think to load it from the file. This involves putting down a read from excel node, getting the file path, parsing the data, etc. I've always wanted to be able to copy/paste straight into a 2D Array, which to my knowledge, isn't possible.

 

However, I came up with a quicker solution! In the attached VI, simply copy your data to a clipboard, drop it on the block diagram, and run it. Save yourself some minutes!

 

Cary Schneider

Download All
Message 1 of 7
(6,366 Views)
Solution
Accepted by topic author CarySchneiderSmiths

A bit easier is to just drop a string constant onto the block diagram and paste into that.  Then you don't need all of the VI scripting functions.

 

 

0 Kudos
Message 2 of 7
(6,361 Views)

Hi Cary,

 

Save yourself some minutes!

😄

Yes, as already mentioned you should use a string control instead!

Guess what: it also works in the opposite direction when copying data from LabVIEW to Excel (using a tab as delimiter)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(6,353 Views)

There is also a "read from Clipboard" method available.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(6,347 Views)

Ah, true! Though, I still like the capability of making use of comments to bring information into the workspace. There's probably some cool function down the road that may make use of it.

 

Sure would be nice to be able to paste data straight into an array or something, though.

0 Kudos
Message 5 of 7
(6,344 Views)

clipboard.png

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 7
(6,335 Views)

For the sake of newbies...

1) Application control->Invoke node->place on canvas
2) Once placed, right click to "select method"->Clipboard->Read From Clipboard

3) format the data with pallette string->format string to array

 

My 1.5 cents

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