08-22-2006 11:59 AM
08-22-2006 12:40 PM
You can make a subvi out of any vi. if you want to start with subviA and modify it then just just do a save as (subviB) and start from there. Your probably just making it harder then it really is. If you want to insert subviB into another vi the you just to the functions pallete and then go to select a vi and navigate to subviB and then hit OK and then wire subviB accordingly.
I would suggest you start with reading the manual (about making subvi's) and looking at the examples. there is also a good book for learning labview called Labview for everyone third edition.
08-22-2006 12:42 PM
You could do a save as (make sure you check the "save a copy without updating callers"). Modify the code of the B.vi as neeeded. essentially you want 2 vis with the same interface (input output terminal structures). Since labview is not OO (I know it is added to 8.20 but this does NOT make a OO language, just a dataflow language which supports a OO model) there is no forced interface implementation. Templates and call by reference do allow for a degree of control of such interface enforcement. One other wat is to have a function with called AB.vi which uses a common vi but adds a switch statment for A or B implementation (poor mans dynamic functions and polymorphism). This does make your code slightly less readable.
Paul