Ton Plomp Posted July 3, 2009 Report Share Posted July 3, 2009 Name: Code Capture Tool Submitter: Ton Plomp Submitted: 03 Jul 2009 Category: LabVIEW Tools Network Certified LabVIEW Version: 2009License 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: Project\Code Capture Tool.vi user.lib\CCT.mnu And the following folder: user.lib\_Code Capture Tool In your LabVIEW data folder (in Windows, this is normally: My documents\LabVIEW 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 2 Quote Link to comment
Ton Plomp Posted October 8, 2009 Author Report Share Posted October 8, 2009 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 Quote Link to comment
jcarmody Posted November 27, 2009 Report Share Posted November 27, 2009 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.   Quote Link to comment
Ton Plomp Posted November 27, 2009 Author Report Share Posted November 27, 2009 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 Quote Link to comment
jcarmody Posted November 27, 2009 Report Share Posted November 27, 2009 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 Quote Link to comment
Ton Plomp Posted November 27, 2009 Author Report Share Posted November 27, 2009 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 1 Quote Link to comment
jcarmody Posted November 27, 2009 Report Share Posted November 27, 2009 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. cct.swf Quote Link to comment
Ton Plomp Posted November 28, 2009 Author Report Share Posted November 28, 2009 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 Quote Link to comment
Ton Plomp Posted November 28, 2009 Author Report Share Posted November 28, 2009 Run the attached VI.Openrwconfig.vi This will open the BD of the VI with the bug. Delete the input wire of the 'Open Config VI.' The next release will have this fixed. Ton Quote Link to comment
jcarmody Posted November 28, 2009 Report Share Posted November 28, 2009 Â That did it for both LV versions. Â Thanks. Quote Link to comment
Ton Plomp Posted November 28, 2009 Author Report Share Posted November 28, 2009 Version 2.0.5 has been released fixing the 'error 7' bug. Ton Quote Link to comment
Ton Plomp Posted November 30, 2009 Author Report Share Posted November 30, 2009 Here's a demonstration video with the new (2.0) features:<br/> <object width="360" height="554"> <param name="movie" value="http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0_controller.swf"></param>'>http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0_controller.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.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/"></param>'>http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/"></param> <embed src="http://content.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/CCT2.0_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.screencast.com/users/TonPlomp/folders/Default/media/4a988906-a72a-41f4-a978-35e68c0f2d20/" scale="showall"></embed> </object> 1 Quote Link to comment
jcarmody Posted November 30, 2009 Report Share Posted November 30, 2009 The Code Capture Tool rocks.  I love it. .  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...  Quote Link to comment
Ton Plomp Posted November 30, 2009 Author Report Share Posted November 30, 2009 The Code Capture Tool rocks.  I love it. .  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...  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 Quote Link to comment
jcarmody Posted December 2, 2009 Report Share Posted December 2, 2009 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! Â Â Â GetSnippet.vi Quote Link to comment
Ton Plomp Posted December 2, 2009 Author Report Share Posted December 2, 2009 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: And I think this code should get the actual snippet (tested): Ton Quote Link to comment
jcarmody Posted December 2, 2009 Report Share Posted December 2, 2009 [...] 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.vi Quote Link to comment
jcarmody Posted December 2, 2009 Report Share Posted December 2, 2009 Â 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? Quote Link to comment
Yair Posted December 2, 2009 Report Share Posted December 2, 2009 You can open the BD of the VI, select the content and (if I'm not mistaken) even copy it to the clipboard. Quote Link to comment
jcarmody Posted December 24, 2009 Report Share Posted December 24, 2009 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... GetCCTSnippet71.llb Quote Link to comment
jcarmody Posted September 21, 2010 Report Share Posted September 21, 2010 Ton, The latest version has two issues that I saw: There's a breakpoint in the installer. I don't see the snippet image in the CCT unless I drag the empty preview area. I tested a snippet from LV2010 to 8.2. It worked beautifully. Thanks for the good work. Jim Quote Link to comment
jimc1041 Posted November 16, 2010 Report Share Posted November 16, 2010 I have just installed the code capture tool opg package in LV8.5.1 and I am having a problem getting it to capture a selected case in the block diagram of a particular VI. Here is a screen capture of the code-capture front panel. Notice that the Block Diagram options are disabled (grayed out). I am able to get the block diagram selection to work with other higher level VI in this project. Thanks in advance for any help you can provide Jim Cardinal Quote Link to comment
Yair Posted November 17, 2010 Report Share Posted November 17, 2010 The block diagram options should be unavailable if the BD is inaccessible. This can happen if the BD has been removed or if the VI does not have one (like a global VI or a control) or if the VI's BD is locked. Looking at the code, it looks like there is one bug there - it compares the lock state to 2 or greater which, according to the help, would prevent the BD from being accessible even if it was only locked. The comparison should be changed to greater than 2 (which should only apply to a password protected BD). If this is important to you, you can change it now, as the code is open source. Quote Link to comment
jimc1041 Posted November 17, 2010 Report Share Posted November 17, 2010 Thanks for the reply. The VI in question is a subVI of a password protected higher level VI. Other that removing the password protection, is there a way to access the BD of the subVI with the code_capture tool? Jim Cardinal Quote Link to comment
Yair Posted November 17, 2010 Report Share Posted November 17, 2010 I don't think that being inside another PW'd VI should have affected the VI you're trying to view, so I'm assuming the actual VI is also PW'd. We did discuss allowing the user to unlock the VI from the CCT at one time, but I was against it, because I didn't want to overload the CCT with more functionality. I believe you should be able to use the CCT to capture the BD if you simply unlock the VI before calling the CCT. If you want to automate this, the VI class should have a method you can call to unlock the VI, but you'll need to provide the password. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.