LabVIEW Idea Exchange

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

Allow to Create VI Snippet Programmatically

Status: Declined

Hello R&D,

 

Further to this message, I'd like to have this feature in LV by way of a VI Server Method.

 

https://forums.ni.com/t5/LabVIEW-APIs-Discussions/Creating-a-VI-snippet/m-p/3402132#M643

 

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

 

 

Thanks,

Partha (CLD, CSP).

- Partha ( CLD until Oct 2027 🙂 )
9 Comments
wiebe@CARYA
Knight of NI

> I'd like to have this feature in LV by way of a VI Server Method.

 

The code capture tool does it programmatically. With little effort, you can use it as an API. What benefit (besides ease of use) would a method offer? Wouldn't a library (functionality already there) be just as useful?

 

Making a snippet actually has little to do with LabVIEW. It's just a VI put in a special tag of a PNG.

parthabe
Trusted Enthusiast

"What benefit (besides ease of use) would a method offer?"

 

I can write a VI to back up my entire project as a Zip folder of VI Snippets (similar to the Save VI Without Diagram method as it exists today), so as to keep the back up copy with less size. Additionally, VI Snippets still preserve the hierarchy of that VI. So, in case something goes wrong some day, at least I can stand to recover soon, instead of writing everything from scratch. So, a Save VI Snippet method would be good to have in the future.

 

And, by the above explanation, one can easily understand that I don't use a SCC tool (server) since I don't have one, and it is not under my control in my current job.

 

Finally, CCT is not one-click right away from the toolbar, and it is not a native feature as on date. So, it is hard to educate the other junior team members about its use-case, and it becomes still harder to convince someone on the client side.

- Partha ( CLD until Oct 2027 🙂 )
wiebe@CARYA
Knight of NI

The point was you can also do that with a VI in an API. No need for a new method.

 

And since it's already being done programmatically, you can use that code to do it programmatically.

wiebe@CARYA
Knight of NI

BTW a zip of the code would be smaller then a zip of snippets of the code.

 

I'm all for a snippet API (but not a method per se). No need for NI to make it. 

 

It doesn't make any sense to me to zip a snippet of a VI as backup. Why not simply zip the VI itself? The snippet will always be larger then the VI, as the snippet contains the VI and it's image.

 

You don't need a server for SCC. Use Mercurial.

AristosQueue (NI)
NI Employee (retired)

Also, the snippets don't store all the other aspects of the project: targets, libraries, classes, typedefs, configuration files, help documentation, design documents, MAX setups, XControls, etc. Snippets make a very poor backup system.

Jonzarwal
Member

Hi guys,

 

I have another use case where it would be very useful to dynamically create snippets.

 

I want to share a PPL to the dev team. This lib has a class that should be used by developpers as a parent class. They have to override a few VIs and they get a ready-to-go child class.
In those VIs to override, the code must be mainly the same but contains some type def which are related to the child class. Using a VI snippet for the overriden method is a very good starting point, as it saves time and standardise the overriden code.

What i imagine is to have a process that automatise the creation of snippets (based on a pool of "template" VIs) during the build of the PPL, and ship them with the PPL.
It would result this:
1. I dev/correct the source code of the library, and its "template" VIs
2. Build PPL, snippets creation, PPL/Snippets shared to the team
3. Team uses the PPL with its compatible snippets (and may find problems -> go back to 1)

 

Do you think it's possible, or is there a better way to do this without using snippets?

 

wiebe@CARYA
Knight of NI

I have to dig deep, but I made snippet support for LV7 at some point. Just for fun.

 

If it helps enough people, I might do the digging and put it online.

 

It's not hard though. Just figure out how to get a VI's file (pref. with a buffer) and add it to a PNG's section.

Jeff-P
NI Employee (retired)
Status changed to: Declined
 
Jeff-P
NI Employee (retired)
Any idea that has received less than 10 kudos within 3 years after posting will be automatically declined.