Jump to content

Code snippets don't always work


Recommended Posts

I suspect there is a simple answer to this, but I'll be darned if I can figure it out. Why don't code snippets always work? For example, I can drag and drop every snippet on this page just fine:

http://zone.ni.com/d...a/tut/p/id/9330

But when I try and drag and drop this snippet:

http://decibel.ni.co...t/docs/DOC-9812

I get the "circle with a line through it" cursor. No error, no explaination, just no drop. It happens all the time on snippets. Is it a version issue? I'm using LV9f2.

Link to comment

I suspect there is a simple answer to this, but I'll be darned if I can figure it out. Why don't code snippets always work? For example, I can drag and drop every snippet on this page just fine:

http://zone.ni.com/d...a/tut/p/id/9330

But when I try and drag and drop this snippet:

http://decibel.ni.co...t/docs/DOC-9812

I get the "circle with a line through it" cursor. No error, no explaination, just no drop. It happens all the time on snippets. Is it a version issue? I'm using LV9f2.

Snippets only work ofr the most trivial examples. Virtually every Snippet that uses a property nodes is bad because it repalce the explicitly linkedproperty node with a ref and a property node where the ref is not for the original control.

If you want to make it work, pop-up on the control and select create ref and use THAT ref instead of the one used in the Snippet.

Confirmed bug by the way,

Ben

Link to comment

Thanks for the reply, Ben

Property nodes may be part of it, but I found some other examples that also don't work. This one uses a strict type def which may be causing the problem:

http://decibel.ni.com/content/groups/northeast-oh-labview-users/blog/2009/09/08/state-machines

This one, even the 2-D array constants (which worked in the link in the orginal post) don't work:

http://decibel.ni.com/content/docs/DOC-6108

Link to comment

Thanks for the reply, Ben

Property nodes may be part of it, but I found some other examples that also don't work. This one uses a strict type def which may be causing the problem:

http://decibel.ni.co.../state-machines

This one, even the 2-D array constants (which worked in the link in the orginal post) don't work:

http://decibel.ni.co...t/docs/DOC-6108

Just look at Snippets as if they where a "Public BETA" for the time being. THe good news is that "Create Sub-VI" did not get damaged along the way. rolleyes.gif

Ben

Link to comment

Eric, Ben,

The issue in this case is not with VI snippets, but how they are attached and/or displayed in forums or web pages. Often the image is just a placholder for the real image file. The placeholder image doesn't contain any of the VI code for the snippet feature to work. When you drag it, you get the circle with line through it (operation not allowed).

When you find these cases, right click on the image and select "Save Target as..." (not "Save Picture as...") to save it to you computer. Then drag the resulting image file to your LabVIEW VI and the snippet should work fine.

I was able to get all the snippets you referenced into LabVIEW, though some searched for missing VIs or typedefs that aren't saved in the snippet.

-Scott

Link to comment

I suspect there is a simple answer to this, but I'll be darned if I can figure it out. Why don't code snippets always work? For example, I can drag and drop every snippet on this page just fine:

http://zone.ni.com/d...a/tut/p/id/9330

But when I try and drag and drop this snippet:

http://decibel.ni.co...t/docs/DOC-9812

I get the "circle with a line through it" cursor. No error, no explaination, just no drop. It happens all the time on snippets. Is it a version issue? I'm using LV9f2.

Your second image doesn't look very 'sharp' an indication the image is rescaled. A good image editor would remove the VI snippet during the scaling. (here's why)

Ton

Link to comment

Eric, Ben,

The issue in this case is not with VI snippets, but how they are attached and/or displayed in forums or web pages. Often the image is just a placholder for the real image file. The placeholder image doesn't contain any of the VI code for the snippet feature to work. When you drag it, you get the circle with line through it (operation not allowed).

When you find these cases, right click on the image and select "Save Target as..." (not "Save Picture as...") to save it to you computer. Then drag the resulting image file to your LabVIEW VI and the snippet should work fine.

I was able to get all the snippets you referenced into LabVIEW, though some searched for missing VIs or typedefs that aren't saved in the snippet.

-Scott

Confession time!

I only looked at the links from the original post and the second one takes you to "Groovy Thermometer" which simply can not work.

Ben

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.