09-28-2017 03:23 AM
When right-clicking on an array, in front panel or block diagram, there is a practical "Export" function, for copying the data to Excel or to clipboard. But I can't find an "import" function, to quickly paste data to an array, is it missing?
09-28-2017 05:57 AM
Hey,
I understand where you are coming from but it would be a bit difficult to make sure the pasted data is in the right format.
If you want that functionality you quite easily use the read from speadsheet VI and wire it to a local variable of the array, that could be done at the start of the problem for example.
09-28-2017 07:45 AM
Not sure if this helps or not but attached is a utility that I use to create array constants.
It can also be used in an application.
To use it:
In a program, you can use the output of the vi.
If you just want an array constant, stop the utility and drag the String Array to a block diagram.
steve
09-28-2017 08:25 AM - edited 09-28-2017 08:25 AM
Is this something you want to bring into a control or constant? If so I've been using a QuickDrop plugin shown here.
http://forums.ni.com/t5/LabVIEW/QD-Shortcut-Paste-to-Array-Constant/m-p/1088366
With it I copy cells from Excel, or a Word table, then I mapped this to CTRL+O (default is CTRL+E) and it will create an array control or constant of the clipboard contents as a string or number.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-28-2017 08:39 AM - edited 09-28-2017 08:42 AM
As stated by NIJimbo, there's no built-in function to accommodate this request. But in general, it's not a very hard problem to resolve. I like to use the "Spreadsheet String to Array" method to create a very simple translation from the clipboard (ascii) to an array I can manipulate.
Good luck.
Ken
09-29-2017 05:34 AM
Hey, I know how to convert a string to array 🙂
The question is about the UI. The QuickDrop mentioned above isn't perfect but helps
09-29-2017 10:01 AM
You could hijack the paste operation using an event structure and use a similar methodology to pull data from the clipboard into your control. This example isn't perfect (as it's based on pasting into the value of the array index control), but it demonstrates how you could tweak the UI to behave how you'd like to perform the paste operation.
P.S. Take a look at the attached VI to get the snippet without all the broken wires and/or refnum shown above.
You could do similarly with a drag-and-drop and/or right-mouse-click action on this control. Or even just implement a paste button next to the control for ease of use.
Good luck.
Ken