Jump to content

Creating Project from template in LV 8


Recommended Posts

We can create VIs from the template in similar fashion i want to create a perticular folder hierarchy and copy some common VIs in perticular locations when i create a new project. as in 7.1(or even in 8) we had option to create blank VI or VI from template, is there any option to blank project or project from template.

If this feature is not readily available then can i develop a tool which can do the job? How?

Link to comment
I don't see any way to do it from LabVIEW, although the project file is just an XML file (try opening one up in a text editor), so you could certainly dynamically create one using LabVIEW itself.

I THINK you can do it from LabVIEW, I can't check it at home, but I recall that the new VI-Server has references (with methods and properties) for Project Items. I was thinking about this since it would equalize the project settings between the different LV-programmers at our site.

You should be carefull with the XML files :nono:

The .lvlib files (Also coded in XML) have some binary info with them as my co-worker found out...

If I get it working (Scripting Projects) I will share (some of) my code!

Ton

Link to comment
You should be carefull with the XML files :nono:

The .lvlib files (Also coded in XML) have some binary info with them as my co-worker found out...

I agree, it is not a good idea to edit the XML. I believe that these files are signed (similar to a checksum), so that LabVIEW knows whether they have edited outside of LabVIEW. If the signature is not valid, then LabVIEW will probably refuse to load the file. However, I have not tested this theory yet. :unsure:

Link to comment
We can create VIs from the template in similar fashion i want to create a perticular folder hierarchy and copy some common VIs in perticular locations when i create a new project. as in 7.1(or even in 8) we had option to create blank VI or VI from template, is there any option to blank project or project from template.

If this feature is not readily available then can i develop a tool which can do the job? How?

maybe the project duplicator tool helps ?

Post#2432

Link to comment
maybe the project duplicator tool helps ?

Post#2432

Tested it, (at work where i can't post) and forgot to take the VI home...

But the good news is, it works. You can create a new project:

Use the 'new' method of the application->project class

With the new reference you can do a lot of things. Only I haven't tested the creation of a build, I think this takes a LOT of settings...

Together with i2dx's tool it should be very interesting,

if I remember it tomorrow afternoon I wil post the code tomorrow

Ton

Link to comment
Tested it, (at work where i can't post) and forgot to take the VI home...

But the good news is, it works. You can create a new project:

Use the 'new' method of the application->project class

With the new reference you can do a lot of things. Only I haven't tested the creation of a build, I think this takes a LOT of settings...

Together with i2dx's tool it should be very interesting,

if I remember it tomorrow afternoon I wil post the code tomorrow

Ton

nice tip! thank you. I found out that there is a "new" method for lvlibs, but I had no time yet to implement that anyway ...

thank you for your feedback. You are the first one (except the 5 stars I got from anonymous ...) so I really appreciate it. I tried to improve it a little bit today, but I had to figure out the scripting property "SubVIs" is giving back an empty array ... [posted here]

That would be extremely helpful to catch these SubVIs, which are in disable structures, and if I could catch the VIs in disable structures, I could put the dynamic VIs in a disable structure and copy them with the structure ...

Link to comment
I agree, it is not a good idea to edit the XML. I believe that these files are signed (similar to a checksum), so that LabVIEW knows whether they have edited outside of LabVIEW. If the signature is not valid, then LabVIEW will probably refuse to load the file. However, I have not tested this theory yet. :unsure:

I actually edited a project file ones or twice because I needed a slightly different application and installer build and didn't want to lose the old ones and was to lazy to create complete new build specs. I simply copy/pasted the appropriete tags in the project file and edited the tags relevant for the naming of the build specs.

This worked fine. I suppose if you stick with the schema for a lvproj everything is OK.

Ofcourse it's always a wise thing to backup your project file before manually editing it. :)

Link to comment
I actually edited a project file ones or twice because I needed a slightly different application and installer build and didn't want to lose the old ones and was to lazy to create complete new build specs. I simply copy/pasted the appropriete tags in the project file and edited the tags relevant for the naming of the build specs.

This worked fine. I suppose if you stick with the schema for a lvproj everything is OK.

Ofcourse it's always a wise thing to backup your project file before manually editing it. :)

cool! Nice tip. I have allready made a suggestion at the "NI wish-list", that it sould be possible to create "derivates" from one build spec, e.g. the one time, you want to build a full installer, or an exe with all support files, the other time, you just want to update the exe file, or you want to update the exe and specific support files .... etc. I also wrote in my suggestion, that the build number should count up automatically and there should be a system variable, containing the actual build number. Maybe it's a little bit difficult to syncronize the build count among the derivates, but hey, they created labview, that task should be easy to them ;)

[edit: why the heck, do I see the typos not until I have posted the message? maybe I need a >post< and a >really post< button ;) - yes, I know there's a preview button ...]

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.