06-23-2017 09:44 AM
I have a main VI that calls a bunch of functions inside a dll (call it "XYZ.dll"). Everytime I make modifications to XYZ.dll and replace the old XYZ.dll with the new file of the same name with the exact same function calls inside, all my Call Library Function Node calls in the main LabView VI get broken. I then have to manually re-link each Call Library Function Node to the new XYZ.dll library. Is there a way to re-link the calls programmatically?
Solved! Go to Solution.
06-23-2017 10:07 AM
This thread might get you started: http://forums.ni.com/t5/LabVIEW/Global-replace-library-path-in-call-library-function-in-multiple/td-...
06-23-2017 10:12 AM
Are you able to specify the dll's path on the block diagram and does it get around this problem?
06-23-2017 11:13 AM
Hi cbutcher,
This definitely looks promising, however I'm not sure exactly how to apply it to my VI. I changed the paths in the code snippet, closed the VI to be updated, ran the script, reopened the VI to be updated, and saw that there was no change to the CLFN dll path...
06-23-2017 11:14 AM - edited 06-23-2017 11:37 AM
@Jacobson, thank you for the suggestion. I'm not sure how to specify the dll's path outside of setting it in the CLFN. Is there a control for the CLFN dll filepath somewhere?
06-23-2017 11:33 AM
I just set CLFN to "Specify path on diagram" and wire the path in as a constant.
06-23-2017 11:40 AM
Ahh thanks, I see that option now. I may have to do that, although I'm hesitant to add an additional filepath wire to 20+ CLFN calls on an already overcrowded block diagram...
06-23-2017 09:51 PM
@Chris_P_SD wrote:
Hi cbutcher,
This definitely looks promising, however I'm not sure exactly how to apply it to my VI. I changed the paths in the code snippet, closed the VI to be updated, ran the script, reopened the VI to be updated, and saw that there was no change to the CLFN dll path...
Ah. I think when I tested it maybe the VI was open. You probably need to add a Save VI invoke node at the end using the VI reference. Sorry I didn't catch this!
06-29-2017 09:38 AM
Thanks Cbutcher, as you suggested, the working code looks like this:
Just to summarize, this mini VI finds all instances of the CLFN (Call Library Function Node) in the target VI, where the target VI is defined in the filepath constant at left-most edge of the block diagram. It then replaces all these instances of the CLFN with the new DLL defined in the bottom filepath constant. This is useful for updating large block diagrams with many CLFN calls that aren't wired to a single filepath constant.
Thanks everyone.
Chris