LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a VI snippet

Has anyone found out how a VI snippet is generated?

Running the actual menu code doesn't seem to work, nor can I find a VI inside the resources folder that seems to create a snippet.

Anyone figured how to do this?

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 1 of 16
(14,802 Views)

So I just played with this for the first time. It sort of works for me. If it doesn't seem to do anything when you try the menu, I'd suggest restarting. I had some weird behavior from the VeriStand evaluation that didn't go away until I restarted (again).

I created a very simple snippet. I can successfully drag the file from the desktop to the block diagram. I can successfully drag the image from Internet Explorer into a block diagram. Dragging from Firefox 3.5.2 just results in a text label with a path to the file in it. I do have No Script installed, but it doesn't seem to indicate that it is doing anything. Anyone have better luck? If this only works in IE, it will have a very limited impact on how I use the forums.

Chris

tewst.png

0 Kudos
Message 2 of 16
(8,954 Views)

There is a known issue with Firefox (and Chrome, and possibly Safari).  You cannot drag a snippet directly from the browser to LabVIEW due to the way these browsers handle cut/paste.  Instead, you need to drag from the browser to your desktop, then from your desktop to the VI.  I know it is a bit clunky, but it works.

0 Kudos
Message 3 of 16
(8,954 Views)

Good to know. Thanks.

0 Kudos
Message 4 of 16
(8,954 Views)

To be clear, this is not about creating a VI snippet using the LabVIEW developement environment, but by doing this programmatically via the LabVIEW API (hence the location on this board).

So if anyone has a VI that can create a snippet of any given selection, pleas post here.

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 16
(8,954 Views)

The commands for VI Snippet are not currently exposed through VI Server.  One of our LabVIEW Product Managers is investigating the feasibility of releasing a G-code method of creating snippets and delivering this to the community in the form of a right-click framework or quick drop plugin.

-Bob

0 Kudos
Message 6 of 16
(8,954 Views)

How about giving us a VI which will accept a path as an input and perform the capture to that path?

That should hopefully make it easier to get it out and will allow us to add this into the CCT (which we're thinking of integrating into the RCF anyway).

The VI itself can be locked if it will call some stuff which you don't want to expose.


___________________
Try to take over the world!
0 Kudos
Message 7 of 16
(8,954 Views)

Ton,

I have looked at the VI snipped functionality and believe that with a little scripting and some external DLL voodoo we can make the same (but better ) also for earlier LabVIEW versions (at least the capture part). That would be a nice CCT addition .

How far back we can go depends only on how far back the Code Selection scripting API will work properly. The rest stays always the same.

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 16
(8,954 Views)

I believe the relevant Copy/Paste Selection methods were available in LV 7.0 (the current version of the CCT), but I don't think the snippet option is very useful without the dropping part. You might be able to write a hook to do that part as well, but I don't see it as worth it. Also, personally I only use 7.0 to support old projects now, so I can't say I have any need for it. I have 2009 and plan to use that going forward.


___________________
Try to take over the world!
0 Kudos
Message 9 of 16
(8,954 Views)

Unfortunately the Copy past selection methods available even in LabVIEW 7.1 are not enough. I do need the possibility to turn a selection into a subVI, which at least in 8.2 is available as a private debug method and later as a slightly different official scripting method. As such it would need to be dynamically called anyhow in the CCT for the system, to be able to make the CCT still work for older versions.

The direct dropping into a diagram prior to LabVIEW 2009 is likely not very easy although I could certainly visualize another tool parallel to the CCT that would allow to at least import it from the desktop for instance using the drop into path control functionality.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 16
(8,954 Views)