LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

looking for a way to create code templates in labview 7

Hi all,

  First of all, this post are all about labview 7.I post a thread about reusing the code before but I think most people's suggestions are only applicable to the new version but not on 7. My issue is we need to reuse some vi's as well as all the dependent subvi's. However, we have to make sure none of the original vi's or subvi's will be modified. So I will copy all the needed vi's or subvi's to a new folder, rename it and have the main code linking to the renamed subvi's. Every time I start a new project, it takes pretty long time to rename all subvi's and do the linking. I am thinking if there is any way to generate the code dynamically and automatically. I am wondering if there is any 3rd party or official program could do that. I am trying to write a program to do so but I soon find that the vi code is encoded and seems no way to replacing the linking path and names for the subvis programically.

 

 

p.d. I know you might be wondering why insisit using 10 years old version. But since the code in our lab are all written in LV7 and the system is too too too big. It takes long time to convert everything to 2012 so up to now, we don't have any choice but keep using LV7

0 Kudos
Message 1 of 10
(2,564 Views)

@dragondriver wrote:

Hi all,

 

 

p.s. I know you might be wondering why insisit using 10 years old version. But since the code in our lab are all written in LV7 and the system is too too too big. It takes long time to convert everything to 2012 so up to now, we don't have any choice but keep using LV7



With that philosophy, we all will have upgraded to LabVIEW 2022, and you'll still be stuck using LabVIEW 7.

 

I suggest you come up with a plan to start upgrading your code in a methodical manner.

 

Note that generally, if you just copy your folder of old code to another named folder, you shouldn't have to rename all the VI's.  I recommend having LabVIEW closed when you do the copying, and don't have any other VI's open from the old folders when you start opening files form the new folder in the new version of LabVIEW.

 

If you start placing your new files into the context of a project, you'll be able to use the files tab of the project window to verify that you don't have any VI's linked to files in the wrong locations or the old folders.

 

For safety, make a backup of all your old files and put them in a safe location so that you can go back and get copies of them in case you ever mess something up in the upconvert process.

0 Kudos
Message 2 of 10
(2,563 Views)
Personally, I totally agree with your point. However, working in a lab is not a personal stuff, there are so many limitation that what can or should do, sigh!



@RavensFan wrote:

@dragondriver wrote:

Hi all,

 

 

p.s. I know you might be wondering why insisit using 10 years old version. But since the code in our lab are all written in LV7 and the system is too too too big. It takes long time to convert everything to 2012 so up to now, we don't have any choice but keep using LV7



With that philosophy, we all will have upgraded to LabVIEW 2022, and you'll still be stuck using LabVIEW 7.

 

I suggest you come up with a plan to start upgrading your code in a methodical manner.

 

Note that generally, if you just copy your folder of old code to another named folder, you shouldn't have to rename all the VI's.  I recommend having LabVIEW closed when you do the copying, and don't have any other VI's open from the old folders when you start opening files form the new folder in the new version of LabVIEW.

 

If you start placing your new files into the context of a project, you'll be able to use the files tab of the project window to verify that you don't have any VI's linked to files in the wrong locations or the old folders.

 

For safety, make a backup of all your old files and put them in a safe location so that you can go back and get copies of them in case you ever mess something up in the upconvert process.


 

0 Kudos
Message 3 of 10
(2,556 Views)

I do have 2012 installed in my personal computer but I cannot use that in lab. What I am wondering is would it be possible to load a vi in 2012 dynamically and rename all the dependent subvi's in program? I saw some introduction about using some property control to modify the property of subvi, if that's possible, I am thinking to write a program to do the work.

0 Kudos
Message 4 of 10
(2,551 Views)

@dragondriver wrote:

I do have 2012 installed in my personal computer but I cannot use that in lab. What I am wondering is would it be possible to load a vi in 2012 dynamically and rename all the dependent subvi's in program? I saw some introduction about using some property control to modify the property of subvi, if that's possible, I am thinking to write a program to do the work.


Scripting?  That officially came out in LabVIEW 8.6.  Even then, the VIs will need to be saved in the version running the scripting.

 

I'm with Ravens Fan.  You really should systematically upgrade your code (and probably computers while you are at it).

 

I'm not totally sure if it was around in 7.1, but you should be able to save a VI as a VIT, which is a VI template.  You can then create a new VI from the template.


GCentral
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 5 of 10
(2,517 Views)

I'm confused as to why the subject line even says "create code templates".  That would imply something to do with .vit files.  Yet, nothing in the messages talks about templates, only about trying to work with VI's in two totally different versions of LabVIEW.

 

I'm actually confused by a number of posts by the original poster.  This message thread talks about LabVIEW 12 and LabVIEW 7.  Other message threads talked about either LabVIEW 11 or 10.  Then this message says that LabVIEW 12 isn't present on the lab computers.

 

So what versions do you actually have and where are they?  You need to pick a version of LabVIEW that you have and work with that.  There is no point in talking about upgrading to LabVIEW 12 if you don't even have it.

0 Kudos
Message 6 of 10
(2,499 Views)

Sorry if the post is misleading. But I stated in the beginning of the post all I stated is about LV7. No offense, but what's the point to look back to my old posts and trying to associate this to the old one? I am asking the way to create a full template in LV7 not asking how to work with LV7 and LV2013. The reason I am asking that is in LV7, even we can create the template, but if you create a new code from that template, all the subvi are still linking to the original one.

No offense again, don't be mad at me, I am only want to see if anyone has similiar question as me with LV7 🙂

 



@RavensFan wrote:

I'm confused as to why the subject line even says "create code templates".  That would imply something to do with .vit files.  Yet, nothing in the messages talks about templates, only about trying to work with VI's in two totally different versions of LabVIEW.

 

I'm actually confused by a number of posts by the original poster.  This message thread talks about LabVIEW 12 and LabVIEW 7.  Other message threads talked about either LabVIEW 11 or 10.  Then this message says that LabVIEW 12 isn't present on the lab computers.

 

So what versions do you actually have and where are they?  You need to pick a version of LabVIEW that you have and work with that.  There is no point in talking about upgrading to LabVIEW 12 if you don't even have it.


 

0 Kudos
Message 7 of 10
(2,483 Views)

OK, I'm one of the guys that have to maintain ancient LV8 code in production use besides doing current development in LV2010 so I'm chiming in 😉

 

In the old days you could only downsave a VI by one version so LV2012 doesn't help you here. It can downsave VIs for LV8.0 but not previous. For the last steps you'd need LV8.0 and LV7.1 .

A question: Why do you have to make a complete copy of your project? Reuse your old project with as little copying as possible: Just copy the VIs you modify, beginning with the top level VI. Only copy subVIs if you have to modify them, too. There's no need to copy code that doesn't have to be modified or isn't used at all.

0 Kudos
Message 8 of 10
(2,464 Views)

I want to second just copying the code.  If you copy a full set of VIs which are linked to each other, and maintain their relative paths, you will not need to relink them; they will point to the correct copy.  If you rename them, you will need to relink them.

 

As an historical note, scripting / VI server was introduced in LabVIEW 5.1.  It was very primitive until about LabVIEW 7.1 or 8.0.  It was buggy until about LabVIEW 2009.  It is relatively stable and feature complete now.

0 Kudos
Message 9 of 10
(2,449 Views)

Since you copy your code library at the start of a project, just open it in a newer version (not sure if 2012 can open LV7 directly) and save all, and skip that old system. 🙂

VI templates are a way to clone/spawn several copies of 1 VI, it's not what you're after.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 10
(2,434 Views)