06-10-2012 02:00 PM
Hi,
I have a code snippet in my user.lib\myVIContent. I can use this tool perfectly to place the vi content into the BD when I am coding, but my question is, is it possible to place this the VI content into Block Diagram with LV Scripting and connect some wires from\to it?
And if it is possible could you tell me how should I do that?
Thank you very much!
Solved! Go to Solution.
06-11-2012 01:18 AM
I don't know of a method to import a snippet (which doesn't mean it doesn't exist, but I wouldn't count on it).
What you can probably do instead is extract the VI data from the PNG file, convert it to an actual VI and then move the code into your VI. Look at the discussion here about importing snippets before LV 2009. It's basically the same process and it includes code and I believe you should also be able to do in-memory (there should be a method for generating a VI from a flattened string).
06-11-2012 01:32 AM
Dear tst,
It seems my question was not really specified correctly. I would like to insert a code part ( as you copy a part of your BD, and paste it somewehere into a new VI BD.) If I can achieve this method by scripting this would be much more faster rather than generate the whole code. So the snippet in this context means a code part.
Thank you for your reply.
06-11-2012 04:13 AM
This selects all the code and copies it to the new VI, just as if you dragged it from one BD to the other:
06-11-2012 04:38 AM
Dear tst,
Wow, thats what I was looking for. Some questions about this workaround:
Thanks in advance!
06-11-2012 04:49 AM
The New Owner input is for the diagram where you want the code to be. If it's in an existing VI, then OVR is one way of getting the VI's reference.
As for the rest, just read the help and play around with it. I don't know any more about this method than you do. The way to work with these things is to poke around and think logically about where things would be.
06-11-2012 04:50 AM
Thank you very much!