kelbro Posted November 30, 2005 Report Share Posted November 30, 2005 I had to swap out an AC source in a test rack. My program has 240 separate calls to this device. Is there a batch method to 'replace all' with the new instrument driver? I know that I can right click and replace each instance but I was hoping there was a quick and easy way to do it. Thanks! Quote Link to comment
Yair Posted November 30, 2005 Report Share Posted November 30, 2005 If all the VIs have the same name, you can close everything, rename your new VI to the same name, open the new VI and then open the top-level VI. Since LV (at least versions 7 and lower) can only hold one VI of a given name at any point, it will take the VI you already loaded instead of the original VI. Quote Link to comment
m3nth Posted November 30, 2005 Report Share Posted November 30, 2005 I had to swap out an AC source in a test rack. My program has 240 separate calls to this device. Is there a batch method to 'replace all' with the new instrument driver? I know that I can right click and replace each instance but I was hoping there was a quick and easy way to do it.Thanks! Your post is somewhat unclear about whether you are using a low level library or code interface node, or whether you are using a VI (which possibly encapsulates the low level call). Your best bet (if you aren't already using a single VI for the call), is to replace the low-level calls with a single (possibly reentrant) VI. That will let you perform driver swaps very easily as already noted. Quote Link to comment
didierj Posted December 1, 2005 Report Share Posted December 1, 2005 As a variant of yen's solution would be to: 1. Open your app, open the different "old" instrument-vi's and rename them according to the vi-names of the new driver. while renaming each call to the instument-vi's is relinked to the new vi, so you have to touch every instrument-vi only once not as many times as it is called. 2. Then save the whole (main-vi and all sub-vi's). 3. Move (not copy) the old instrument driver to a save place (not in "National Instruments" or your app folder-tree). 4. Put the new instrument driver into the "National Instruments\instr.lib" folder. 5. Reload your app. There might be a message-window, telling you this and that vi was loaded from a different location. Check if it's correkt. 6. Save your app. :thumbup: 7. Now it's save to copy your original (without the created vi's in step 1) "old" instrument-driver back to "instr.lib". Take care that you do not miss any vi (might include typedefs, templates,...) otherwise you end up with mixed instrument-calls and broken sub-vi calls . It might be a good thing to first copy the old and new instrument-vi's to a save place, in case something goes wrong or you missed something. Quote Link to comment
kelbro Posted December 2, 2005 Author Report Share Posted December 2, 2005 Thanks for the tips. Quote Link to comment
Jeffrey Habets Posted December 6, 2005 Report Share Posted December 6, 2005 And while your at it.. Write wrapper VI's for your driver (encapsulate) and use these throughout your application. This way, the next time the same problem arrises, all you have to do is change the wrapper VI's to use the new driver. 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.