neo_zion Posted May 24, 2011 Report Share Posted May 24, 2011 I have a set of drivers which I am trying to disconnect from *.lvlib file and distribute as *.llb file. But whenever I save it to a new distribution,it shows that all member files retains lvlib dependency, Is there any way to remove this lvlib dependency at single shot? -I have around 350 files, hence opening and disconnecting will be last option. Is there anyway I can disconnect all the strict typedef files from the member library files? i.e single click to remove all typedefs in all member files of an LLB or lvlib? Please find the attached llb file and you could see that all member files have dependency with a lvlib file which is part of the attached llb. I just want to remove the lvlib dependency. Sorry if I am over communicating. Thanks in advance, Neo 3570 Driver.llb Quote Link to comment
Ton Plomp Posted May 24, 2011 Report Share Posted May 24, 2011 What is the specific reason you want to disconnect from the lvlib? The lvlib can be included with the LLB like any other LabVIEW file. However you should disconnect each VI from the owning lvlib, there might be a VI-server method for this, but I am not sure. Ton Quote Link to comment
Jon Kokott Posted May 24, 2011 Report Share Posted May 24, 2011 You can disconnect a VI from its owning library with the "disconnectFromLibrary" method. As far as disconnecting all the typedefs from a library of VIs, I'm not aware of any way to do this without scripting. The best way to do this would be to 1. open the library reference (I prefer to open a VI in the library, and use a "library" property node read.) 2. Invoke node on library "Get All Decedents" and get the Control VIs from this 3. Read the "VI Reference" in a for loop of the decedent results. 4. Set the "VI Control Type" property to control. 5. Save each VI with an invoke node save. 6. While you are at it get all the standard VIs and "disconnectFromLibrary" method. 7. Save standard VIs 8. Save the library. That will disconnect all typedefs by saving them as a standard control instead of manually disconnecting them in each VI (that is a huge pain, I wouldn't even try.) the disconnectFromLibrary method will take them all outside of the .lvlib as well. Before you try any of this, make sure you back everything up, including the projects that use this library. Additionally I would run your script from the same project instance as the one that you use these VIs in. Sometimes Labview gets confused otherwise when you reopen the project. ~Jon 1 Quote Link to comment
neo_zion Posted May 25, 2011 Author Report Share Posted May 25, 2011 What is the specific reason you want to disconnect from the lvlib? The lvlib can be included with the LLB like any other LabVIEW file. However you should disconnect each VI from the owning lvlib, there might be a VI-server method for this, but I am not sure. Ton My customer doesn't want its dependency with lvlib files. He likes the old way of code distribution. Quote Link to comment
neo_zion Posted May 25, 2011 Author Report Share Posted May 25, 2011 You can disconnect a VI from its owning library with the "disconnectFromLibrary" method. As far as disconnecting all the typedefs from a library of VIs, I'm not aware of any way to do this without scripting. The best way to do this would be to 1. open the library reference (I prefer to open a VI in the library, and use a "library" property node read.) 2. Invoke node on library "Get All Decedents" and get the Control VIs from this 3. Read the "VI Reference" in a for loop of the decedent results. 4. Set the "VI Control Type" property to control. 5. Save each VI with an invoke node save. 6. While you are at it get all the standard VIs and "disconnectFromLibrary" method. 7. Save standard VIs 8. Save the library. That will disconnect all typedefs by saving them as a standard control instead of manually disconnecting them in each VI (that is a huge pain, I wouldn't even try.) the disconnectFromLibrary method will take them all outside of the .lvlib as well. Before you try any of this, make sure you back everything up, including the projects that use this library. Additionally I would run your script from the same project instance as the one that you use these VIs in. Sometimes Labview gets confused otherwise when you reopen the project. ~Jon Thanks a lot for your suggestion. I am able to disconnect the VI's from library. However I am not able to "Set the "VI Control Type" property to control" which is mentioned in your Step 4. I would really appreciate if you could modify the attached VI to incorporate the step 4 mentioned. Thanks, Neo disconnect from library.vi Quote Link to comment
Jon Kokott Posted May 25, 2011 Report Share Posted May 25, 2011 Thanks a lot for your suggestion. I am able to disconnect the VI's from library. However I am not able to "Set the "VI Control Type" property to control" which is mentioned in your Step 4. I would really appreciate if you could modify the attached VI to incorporate the step 4 mentioned. Thanks, Neo You probably don't have VI scripting enabled in the labview enviornment. do a quick google search and it should tell you how to do it depending on the version of labview you are using (it requires a download pre 2010 i believe) a couple of pointers for your script, load all the VI references first before modifying. sometimes save dialogs will come up if you do not do it this way as they enter/leave memory. I would modifiy the code to do the following: one for loop to load the VIs (get the VI reference) one for loop to modify (disconnect from library, then test if it is a control, if it is, set it to standard control) one for loop to save them all to a new path. one more for loop to simple "save" them (do not put in a path) you have to double save because you are moving subVI dependencies and that is important to the loaded VIs. So even though you are saving the VI you modified, you have to resave to account for repathing. Do not save copies. The references will get all out of whack with cross links if you try to load your new copy VIs. just backup your work first in case something gets hosed. one more thing, when you get all dependencies in the library, feed it the constant string "VI" you don't have to for this particular .lvlib since there are only VIs in it, but if there was a virtual folder or something else it would break your script. ~Jon I'd modify it for you but I can't upload code right now. Its probably better in the long run that you learn to do it anyway. ~Jon 1 Quote Link to comment
SteveChandler Posted May 25, 2011 Report Share Posted May 25, 2011 My customer doesn't want its dependency with lvlib files. He likes the old way of code distribution. Well the customer is always right. Or at least they always need you to make them feel that way. I have found that putting an idea into the customers head in such a way that they think it was their idea is the best way to handle these types of customers. The best way to do that is with the right questions. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 25, 2011 Report Share Posted May 25, 2011 Well the customer is always right. Or at least they always need you to make them feel that way. I have found that putting an idea into the customers head in such a way that they think it was their idea is the best way to handle these types of customers. The best way to do that is with the right questions. [OT] I had a boss that never liked any idea anyone ver came up with but he liked his and eventually I figured his memory was not so good. So the phrase "I was thinking about that idea of yours and think is was a good one..." He was much easier to manage that way. Ben Quote Link to comment
neo_zion Posted May 26, 2011 Author Report Share Posted May 26, 2011 You probably don't have VI scripting enabled in the labview enviornment. do a quick google search and it should tell you how to do it depending on the version of labview you are using (it requires a download pre 2010 i believe) a couple of pointers for your script, load all the VI references first before modifying. sometimes save dialogs will come up if you do not do it this way as they enter/leave memory. I would modifiy the code to do the following: one for loop to load the VIs (get the VI reference) one for loop to modify (disconnect from library, then test if it is a control, if it is, set it to standard control) one for loop to save them all to a new path. one more for loop to simple "save" them (do not put in a path) you have to double save because you are moving subVI dependencies and that is important to the loaded VIs. So even though you are saving the VI you modified, you have to resave to account for repathing. Do not save copies. The references will get all out of whack with cross links if you try to load your new copy VIs. just backup your work first in case something gets hosed. one more thing, when you get all dependencies in the library, feed it the constant string "VI" you don't have to for this particular .lvlib since there are only VIs in it, but if there was a virtual folder or something else it would break your script. ~Jon I'd modify it for you but I can't upload code right now. Its probably better in the long run that you learn to do it anyway. ~Jon Got it right this time. Though I was using LV2010, my scripting was disabled. Thanks a lot for such a detailed and clear explanation. You are absolutely right, I should spend more time to explore these properties. Attaching what I have done,If it's going to be useful for another wire-worker. @Jon, I don't see a way to give kudos here. Thanks a lot. I don't use LAVA very often, I think I should visit here more often . Got it right this time. Though I was using LV2010, my scripting was disabled. Thanks a lot for such a detailed and clear explanation. You are absolutely right, I should spend more time to explore these properties. Attaching what I have done,If it's going to be useful for another wire-worker. @Jon, I don't see a way to give kudos here. Thanks a lot. I don't use LAVA very often, I think I should visit here more often . Oops, missed the attachment here. disconnect from library.vi 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.