Jump to content
Daniel_Chile

Get string constants from diagram, programmatically

Recommended Posts

Hello.

 

I need to get all the string constants in the block diagram of a bunch of VIs, programmatically, and save them to a CSV file. What would be the most effective method?

 

Regards,

 

Daniel

Share this post


Link to post
Share on other sites

Something simple like this should work:

 

post-3889-0-56971300-1406676655_thumb.pn

 

Just pass a reference to the VI you want to use.

Edited by GregSands
  • Like 1

Share this post


Link to post
Share on other sites

Thanks, Greg.

 

However, one thing I did not mention is that the code I want to inspect is in LabVIEW 8.5.1. I can inspect my LV851 code from LV 2013 using VI Scripting, but now I wonder if there is one method I can use from within LV851.

 

Kind regards.

Share this post


Link to post
Share on other sites

Versions 8.6 to 2009 scripting can be accessed using these instructions.

 

https://decibel.ni.com/content/docs/DOC-4973

 

I can't remember but I think 7.x era you used the SuperSecret INI key, and I can't remember the steps for 8.0-8.5.  In any case scripting existed in some form back that far.  Try this VI that I saved back to 8.5.  I don't have 8.5 to test it on so no idea if it works.

Get String Const.vi

  • Like 1

Share this post


Link to post
Share on other sites

Thanks, Hooovahh.

 

Your VI didn't work because the "traverse" subVI was missing. However, I've put together a working VI in LV2013, without subVIs, and saved it to LV851 as you suggest. I opened in LV851, one last minor change and voilá! It worked.

 

post-52498-0-50744600-1406739047_thumb.p

 

Thank you all. LAVA is a great support resource. Kind regards,

 

 

Daniel

Share this post


Link to post
Share on other sites

That approach won't work for constants inside structures...the AllObjs[] property of the TopLevelDiagram class does not recurse into structures.

 

The Traverse VI is present in LabVIEW 8.5., just with a different name/location: [LabVIEW 8.5]\vi.lib\Utility\traverseref.llb\TRef Traverse for References.vi.

  • Like 1

Share this post


Link to post
Share on other sites

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.