LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy and disconnect driver project from instr.lib - safe way?

Solved!
Go to solution

Hello,

 

It sounds simple, but I do not know the proper way to do the following:

I have developed a project style driver for a RS232 instrument. I have this folder including lvlib and lvproj files under the instr.lib folder (LV2017). What I would like to do, is to use this driver project folder as a starting point to develop another (similar instrument) driver. However, if I just copy this folder to a new location, the files keep their path obviously, so if I start to modify/delete files in the new location, I might screw up the files inside the instr.lib, which I really want to avoid.

 

I could just remove all files from the project, and add manually them back to the project, but pointing to the new path, but this is a slow process.

Is there a proper and fast way to do what I want? Even if I rename the lvlib and lvproj files in the new location, the other files are still pointing back to the instr.lib. How can I properly "disconnect" ALL files in this new folder so I can change files in a safe way?

Thanks for any hints!

0 Kudos
Message 1 of 4
(3,407 Views)
Solution
Accepted by topic author Blokk

1. You might want to look into making a project template.

2. The most thorough way I have heard to do this is to move your code out of instr.lib, mass compile (to update the paths to not point to instr.lib), copy the entire project elsewhere, edit/rename the new project, move everything back into instr.lib.  Yes, it is a pain.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(3,393 Views)

I agree, it is a pain. Anyway, I mark your answer as a solution, since I am not aware of any other way. So what I did, I copied the driver folder into another folder. I even deleted the original driver from the instr.lib (because even using the mass compile, every path got messed up 🙂 ). After this, I renamed the lvproj and lvlib, then I started to open all the controls and VIs in the project one by one, and fixing the paths... took some time, but now I have a separate driver folder, I also changed the icon colour 🙂

 

As a last step, I re-created the original driver folder under instr.lib from my network backup.

 

I really need to learn object oriented programming! These two devices have very similar RS232 command list, and since both from MKS, they use the same query/response syntaxes. I imagine, both could have inherited from a common "MKS driver class"... anyway, future plan, no idea how future 😄

0 Kudos
Message 3 of 4
(3,358 Views)

Blokk wrote:

I really need to learn object oriented programming! These two devices have very similar RS232 command list, and since both from MKS, they use the same query/response syntaxes. I imagine, both could have inherited from a common "MKS driver class"... anyway, future plan, no idea how future 😄


Yes, OOP would save you a lot of time there.  For example, I had to interface to multiple versions of a device, one had 14 characters in a message, another had 16.  And since the instrument was so horrible, I needed to know that so I could check for missing characters (yes, it would randomly drop a character even though it is simple RS-232).  So I wrote the driver for the first one.  And then for the second, I just inherited from the other and override 1 VI (the valid message check).  It took more time to add code to select which instrument to use than it did to make the new driver.

 

That code ended up using at least 5 different instruments that I am aware of, plus a "manual input instrument".  OOP made it so easy to add instruments without changing my main instrument loop other than the instrument initialization (which was very simple to do).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(3,351 Views)