Jump to content


Photo
* * * * * 1 votes

[LVTN] Code Capture Tool


  • Please log in to reply
55 replies to this topic

#1 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 03 July 2009 - 06:12 AM

*
POPULAR

Posted Image

Name: Code Capture Tool
Submitter: Ton Plomp
Submitted: 03 Jul 2009
Category: LabVIEW Tools Network Certified
LabVIEW Version: 2009
License Type: BSD (Most common)

The Code Capture tool allows you easily create screenshots of you LabVIEW code for use in documentation, web-sites, wikis, emails.

This tool provides an API for creating images of LabVIEW code as well a GUI for easy capturing and use of code.
Further info is provided in the help-screen (F1) of the program.

For the latest version visit the Code Repository

For the latest version of the source code, visit SourceForge

For more info, visit the LabVIEW wiki with the documenation.


A series of videos is available on screencast: Code Capture Tool








Installation

============

To install the Code Capture Tool, run the 'Install Code Capture Tool.vi' in the LabVIEW version of your choice, or use the OGP file in conjunction with VIPM.

A wizard will guide you through the installation procedure.


Usage
============
After installing and restarting LabVIEW, you can open the Code Capture Tool via the 'Tools' menu to capture an image of the current VI.
For more info open the About screen of the GUI.

Uninstalling
============
To remove the Code Capture Tool from your LabVIEW installation remove the following files in your LabVIEW folder:
ProjectCode Capture Tool.vi
user.libCCT.mnu

And the following folder:
user.lib_Code Capture Tool


In your LabVIEW data folder (in Windows, this is normally: My documentsLabVIEW Data) is a configuration file called Code Capture Tool.ini, which can be removed at any moment. However this file can be shared between mulitple versions of LabVIEW, I recommand you to use a special LabVIEW data folder for each LabVIEW version.

Contact
============

Comments, bugs and thank yous can be expressed to the NI Forums community , and on the LAVA community at the CCT discussion thread.


Click here to download this file
  • Antoine Ch‚lons and jcarmody like this

#2 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 08 October 2009 - 08:09 PM

Hi All,

I am looking for beta testers of a new version of the Code Capture Tool.

Especially people in posession of multiple LabVIEW versions on Mac and Linux.

So if you could sent me a PM with your configuration, I try to respond to you.

Ton

#3 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 27 November 2009 - 01:18 PM

I tried to install this from VIPM without success. †VIPM couldn't install it for LV 8.2; 8.6 completed successfully but I got an "Error 7 occurred at Open Config Data.vi" in 8.6. †I went back and ran Install Code Capture Tool.vi in 8.6 and got the same error. †

Without CCT, I'll have to resort to †taking pictures of my monitor to attach to my posts. ††:wacko:

You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#4 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 27 November 2009 - 02:00 PM

Hi jcarmody,

what OS are you on?
Do you have read/write privileges on your LabVIEW data folder? Especially the Code Capture Tool.ini file?

Ton

#5 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 27 November 2009 - 07:24 PM

what OS are you on?
Do you have read/write privileges on your LabVIEW data folder? Especially the Code Capture Tool.ini file?

Windows XP
Yes

You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#6 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 27 November 2009 - 08:17 PM

I tried to install this from VIPM without success. †VIPM couldn't install it for LV 8.2; 8.6 completed successfully but I got an "Error 7 occurred at Open Config Data.vi" in 8.6. †I went back and ran Install Code Capture Tool.vi in 8.6 and got the same error. †

Could you run the Install Code Capture Tool.vi on 8.2?
I have tested the OGP file on Vista for all versions I currently have (7.0-2009)

Windows XP
Yes

Will try to check that later.
I will sent you an edited version privatly.

Ton
  • jcarmody likes this

#7 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 27 November 2009 - 11:01 PM

I just tried Install Code Capture Tool.vi on 8.2 without success. †I've attached a screen capture of the result. †A small window flashes after a slight pause, before the error message comes up. †Perhaps that's a clue to what's happening?

I tried the version you sent privately, but it didn't change anything. †Perhaps I'll wait a few days to see if other folks with XP have the same trouble I'm having. †I'd hate to have you spend time fixing something that isn't broken on your end.

Thanks.

Attached Files

  • Attached File  cct.swf   126.5KB   386 downloads

You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#8 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 28 November 2009 - 01:43 PM

I just tried Install Code Capture Tool.vi on 8.2 without success. †I've attached a screen capture of the result. †A small window flashes after a slight pause, before the error message comes up. †Perhaps that's a clue to what's happening?

I tried the version you sent privately, but it didn't change anything. †Perhaps I'll wait a few days to see if other folks with XP have the same trouble I'm having. †I'd hate to have you spend time fixing something that isn't broken on your end.

Thanks.

I was able to replicate the problem you have (on XP)
Trying to debug...

Ton

#9 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 28 November 2009 - 03:32 PM

Run the attached VI.Attached File  Openrwconfig.vi   11.13KB   394 downloads
This will open the BD of the VI with the bug.
Delete the input wire of the 'Open Config VI.'
1ReadWriteConfig__CCT_BD.png

The next release will have this fixed.

Ton

#10 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 28 November 2009 - 04:34 PM

†That did it for both LV versions. †Thanks.

You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#11 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 28 November 2009 - 07:12 PM

Version 2.0.5 has been released fixing the 'error 7' bug.

Ton

#12 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 30 November 2009 - 08:28 AM

Here's a demonstration video with the new (2.0) features:<br/>

<object width="360" height="554"> <param name="movie" value="http://content.scree...r.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/FirstFrame.png&containerwidth=360&containerheight=554&showstartscreen=true&showendscreen=true&loop=false&autostart=false&color=1A1A1A,1A1A1A&thumb=FirstFrame.png&thumbscale=45&content=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.scree...2d20/"></param> <embed src="http://content.scree...controller.swf" quality="high" bgcolor="#FFFFFF" width="360" height="554" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/FirstFrame.png&containerwidth=360&containerheight=554&showstartscreen=true&showendscreen=true&loop=false&autostart=false&color=1A1A1A,1A1A1A&thumb=FirstFrame.png&thumbscale=45&content=http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0.mp4" allowFullScreen="true" base="http://content.scree...-35e68c0f2d20/" scale="showall"></embed> </object>
  • jcarmody likes this

#13 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 30 November 2009 - 01:21 PM

The Code Capture Tool rocks. :thumbup1:†I love it.†:wub:. †The video was a great touch, too.

Just to be clear (because I can't test it) folks will be able to drag a snippet made with the CCT in LV 8.6 to a LV 2009 BD?† I'm wondering when CCT 3.0 will come out, with the ability to extract the code from a snippet in pre-2009 versions... †:unsure:

You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#14 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 30 November 2009 - 05:18 PM

The Code Capture Tool rocks. :thumbup1:†I love it.†:wub:. †The video was a great touch, too.

Thanks

Just to be clear (because I can't test it) folks will be able to drag a snippet made with the CCT in LV 8.6 to a LV 2009 BD?

Yes you will, I have created a snippet on Linux 8.2 and imported on Windows 2009

† I'm wondering when CCT 3.0 will come out, with the ability to extract the code from a snippet in pre-2009 versions... †:unsure:

Shouldn't be too hard (yours to try), but the code is embedded inside a PNG tag as a saved VI, just open up and dump like a merge VI.

Ton

#15 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 02 December 2009 - 01:14 AM

Shouldn't be too hard (yours to try), but the code is embedded inside a PNG tag as a saved VI, just open up and dump like a merge VI.

Here's a LabVIEW 8.6 VI that takes a path to a snippet-embedded PNG file and creates a snippet.vi in the same folder. †I'm not happy with the way I did it; it works, but I have a feeling that there's a more elegant method. †The next thing I'd like to try is to make a JKI RCF plugin that converts a PNG on the BD into code. †It would be nicer to be able to have LabVIEW respond to a PNG being dropped onto the BD; do you know how I might do that?

Hey folks! †This picture is a Snippet made with the Code Capture Tool in LV 8.6! †:thumbup1:

GetSnippet_BD.png

Attached Files


You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#16 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Members
  • PipPipPipPipPipPip
  • 2,005 posts
  • Location:New Zealand
  • Version:LabVIEW 2012
  • Since:2000

Posted 02 December 2009 - 07:45 AM

I am wondering how your code actually works since the snippet is embedded in a 'niVI' chunk preceded by the chunk size.
The snippet is created in 'user.lib\_Code Capture Tool\CCT Class\Software\Methods\Private\Snippet\CCT_Snippet__CCT.vi'
Here is a screenshot of the VI that creates the chunk:
PNG chunk.png
And I think this code should get the actual snippet (tested):
VI Snippet extraction.png

Ton

#17 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 02 December 2009 - 12:26 PM

[...] the snippet is embedded in a 'niVI' chunk preceded by the chunk size. [...]

Thanks. †I actually had studied the vi that embedded the snippet but took the long way around. †It's much prettier now :).

GetSnippet_BD.png

Attached Files


You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#18 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 02 December 2009 - 06:04 PM

†Does it make sense to add this to the end of the VI? †Is there a more appropriate way to open a VI for editing?

OpenSnippet.png

You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

 


#19 Yair

Yair

    Extwemely Active

  • Members
  • PipPipPipPipPipPip
  • 2,746 posts
  • Version:LabVIEW 2009
  • Since:2003

Posted 02 December 2009 - 06:46 PM

You can open the BD of the VI, select the content and (if I'm not mistaken) even copy it to the clipboard.

#20 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 867 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2013
  • Since:2007

Posted 24 December 2009 - 05:12 PM

Here's a LV7.1 llb that will extract a snippet made with the CCT, and a snippet to test it with. †Put the llb into [LabVIEW]\project and restart LabVIEW to use it. †Put the snippet in a BD, select it and click Tools -> GetCCTSnippet. †Now all I need is for folks to make snippets instead of screen shots...

GetSnippet_BD71.png

Attached Files


You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice