LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
JonathanLindsey

Resolve links to VI snippets

Status: New

VI snippets are useful but often hard to deal with. Sometimes you can drag one directly from a website into LabVIEW and have it just work. Other times you have to download it, open File Explorer to it and drag the file into LabVIEW.

 

Many times dragging directly from a website doesn't work and results in a comment with a link to the VI snippet. Instead LabVIEW should try to go to the link, download it and insert it as a VI snippet. There are some cases when this will not work (for example the user needs to sign into the website) but LabVIEW should at least try the link. It is possible a link will be provided to LabVIEW that is not a VI snippet in which case LabVIEW should recognize that and just treat it as a normal link.

 

I'm not sure but there may be cases when a PNG image is dragged or pasted onto the block diagram. Is there a possibility for LabVIEW to check if it is a VI snippet and treat it as such?

13 Comments
wiebe@CARYA
Knight of NI

The problem is with the website(s), not with LabVIEW.

 

The NI Forum reduces size of the PNGs, probably to save bandwidth. This process also removes the embedded VI. That should be fixed.

 

I don't think using the URL won't work, because it will be the URL to the reduced image, not the original image. So the embedded VI still won't be there.

 


@JonathanLindsey wrote:

I'm not sure but there may be cases when a PNG image is dragged or pasted onto the block diagram. Is there a possibility for LabVIEW to check if it is a VI snippet and treat it as such?


I always drag snippets onto the block diagram. If it is a snippet, the code will be pasted. I don't see any problem here.

AristosQueue (NI)
NI Employee (retired)

JohnathanLindsay: Do you have a URL you could point to where this occurs that we can look at?

wiebe@CARYA
Knight of NI

@AQ: No snippet from the forum works properly as expected. There was a sticky post about it, but I think it's gone now. The problem isn't.

 

This snippet  for instance.

 

"Save image" saves https://ni.i.lithium.com/t5/image/serverpage/image-id/272899i27A3C2002D451EA3/image-size/large?v=1.0.... This one has the snippet removed.

 

It should save https://ni.i.lithium.com/t5/image/serverpage/image-id/272899i27A3C2002D451EA3, which still has the snippet.

 

You'd still need to save the image. Even with the right image, a copy paste doesn't seem to work.

JonathanLindsey
Member

Agreed some websites are simply incompatible with VI Snippets but here is an example where LV should be able to figure things out automatically.

 

  1. Go to https://bitbucket.org/JonathanLindsey/lv-snippet-test/issues/1/lv-snippet and drag the snippet onto the block diagram.
  2. Notice it is just a link.
  3. Open the link.
  4. Right click -> Save Image as...
  5. Drag the image from file explorer onto the block diagram. It works!

Steps 2 - 5 should happen automatically without the user even knowing. Here is a video showing all 5 steps.

 

 

 

P.S. I can't even attach files here. Why!!!???

wiebe@CARYA
Knight of NI

This could be a limit of the Window clipboard.

 

I'm not sure if a copy\paste or drag\drop of an image puts the original PNG (or a link to it) on the clipboard. Perhaps only the bytes are available. That would make it impossible.

 

If it is possible, I'd like it. So +1 for me.

Intaris
Proven Zealot

For me personally, I would prefer a right-click option on the BD after the link has been pasted to resolve the link to the snippet as opposed to doing that automatically. What if I want to paste a link and I can't because LV recognises it's a snippet.... That would annoy me.

 

But having said that, a possible IDE slowdown due to checking all kinds of URLs in the background would also annoy me

wiebe@CARYA
Knight of NI

I think the clipboard will contain information about the data. If it is an image, it will (also) contain image data. So LabVIEW will be able to distinguish between an image copy\paste or drag\drop and just any link by examining the clipboard data. There'd be no need to resolve the URL. That would be bad.

 

I wouldn't mind getting the URL as a link, and a manual right click to get the snippet. 

 

That might actually be doable as a right click plug in... We could even remove the NI Forum fluff.

wiebe@CARYA
Knight of NI

I just tested this again.

 

If I now drag\drop this https://ni.i.lithium.com/t5/image/serverpage/image-id/272899i27A3C2002D451EA3 image on a LV20 diagram, I do get the code.

 

Not sure why it failed before...

 

Copy image and paste doesn't work.

JonathanLindsey
Member

For me personally, I would prefer a right-click option on the BD after the link has been pasted to resolve the link to the snippet as opposed to doing that automatically. What if I want to paste a link and I can't because LV recognises it's a snippet.... That would annoy me.

 

But having said that, a possible IDE slowdown due to checking all kinds of URLs in the background would also annoy me

 --

 

Maybe LabVIEW could recognize that the a link is likely to be a snippet without resolving the link and suggest that it be resolved as a VI snippet. That way you don't have to figure out that there is a right-click option for it.

wiebe@CARYA
Knight of NI

>Maybe LabVIEW could recognize that the a link is likely to be a snippet without resolving the link and suggest that it be resolved as a VI snippet. That way you don't have to figure out that there is a right-click option for it.

 

I don't see how LV would know this https://ni.i.lithium.com/t5/image/serverpage/image-id/272899i27A3C2002D451EA3 is a link to an image... The text "image"?