LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a VI snippet

Hi Rolf,

thanks a lot, do you want to test and debug the code yourself or should I take that job?

Thanks again,

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 11 of 16
(3,085 Views)

Well the actual PNG code is C programming which is a bit of a work and once I have it I will let you know and then you can do some tests with it. I also was experimenting a little in LabVIEW 7.1 about using the Copy/Paste operators there to implement a create subVI from selection function. I'm pretty sure it can be done but it is a bit of a hassle since you would need to temporarely make some modifications to the original VI and such nasty things.

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 16
(3,085 Views)

With the Help of Darin, I was able to integrate snippet creation in the Code Capture Tool in LabVIEW 7.0.

Dropping is limited to LabVIEW 9.0.

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 13 of 16
(3,085 Views)

We now can open a VI snippet made with the CCT in LabVIEW 8.6 with this VI.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 14 of 16
(3,085 Views)

@RDR wrote:

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


Hi All,

 

I understand that this thread is almost a decade old now, but just wanted to check if any progress/improvement has been made to this expected feature - "creating a VI snippet  programmatically".

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 15 of 16
(2,571 Views)

Hope I'm not too late to the game. I put together a VI Snippet Import Library, up on GitHub, to import VI Snippets programmatically (see llb attached). Under the hood, VI Snippets are no more than custom PNG data chunks that contain the binary VI file. The library saves and loads the "niVI" chuck to the clipboard (within the context of the block diagram) and then pastes the code to the destination VI specified.

 

VI Snippet PNG Chunks:

  • "IHDR": PNG header information
  • "IDAT": PNG image data
  • "niVI": LabVIEW VI code << this is the secret sauce
    • E.g. "RSRC...VI_NAME.vi"
  • "tEXt": LabVIEW VI Snippet help text
    • E.g. "National Instruments Software This image contains an embedded VI File. For more details visit ni.com/info and enter 'ex6a7h' "
  • "IEND": PNG end of file

I realize this is geared for importing VI Snippets, but the principles for exporting should be the same.

 

Best Regards, Ryan

0 Kudos
Message 16 of 16
(2,091 Views)