Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically modify project SV properties

I have noticed that in the LV 8.6 release there is a full API for managing the LV project and all of its components.

It seems very possible with the right instruction to be able to manipulate I/O variable properties such as

alias name, scaling, etc.  I have been knocking on this door for awhile and was hoping some kindly R&D individual

might throw me a few bones (vi's) to get started.

0 Kudos
Message 1 of 11
(5,095 Views)

I meant to say Programmatically modify project I/O variable properties.

So far I have a crude method that modifies the .lvproj file (which is xml) to

rename the I/O variable alias and scaling.  This works butit would be much better

to be able to do this via the project refnum in LV.

0 Kudos
Message 2 of 11
(5,094 Views)

Check out these links:

 

http://zone.ni.com/devzone/cda/epd/p/id/5209

 

http://decibel.ni.com/content/docs/DOC-2031

 

 

0 Kudos
Message 3 of 11
(5,092 Views)
Ok, thanks for the links.  I get the general idea but am stumped on what Type names are to be used to get at the cRIO module tags.
0 Kudos
Message 4 of 11
(5,086 Views)

Here is my crude attempt to do this.

0 Kudos
Message 5 of 11
(5,040 Views)

sachsm,

 

I would not recommend doing this for your cRIO I/O Nodes.  I would suggest doing this manually rather than modifying your .lvproj file, as this is generally a bad idea.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 6 of 11
(5,017 Views)

I think I understand the possibilities of corrupting the lvproj file.  This is only a tool for my personal use and comes with a strong warning

to back up your project file before using.  However I certainly do indend to keep using it and expand it to work with projects that have multiple 

cRIO chassis and also to be able to set channel scaling parameters.  If you really want to help out you could dig around and try to find out how to use the

existing project refnums to get at these properties and then I could upgrade my utility to work properly.  Also, in another forum post I mentioned that

there is a bug in the project that resets all alias names when attempting to move a cRIO chassis module within a project.  This is another reason

that this tool is useful to me.

 

0 Kudos
Message 7 of 11
(5,010 Views)

Hey Mike,

 

I think this will get you started.

 

Attached are a project with a module, and a VI that can rename all the IOVs under the module.

 

Scaling is also an available property. 

 

Make sure you fill out the array with 8 names, and then run it. The project has to be open to do this, but the VI can open it. Also, if you programmatically close the project, make sure you save it first with an invoke node.

 

Hope this helps!

 

Kurt

 

Kurt Williams | LabVIEW Real-Time Product Manager | National Instruments 

 

 

0 Kudos
Message 8 of 11
(4,994 Views)

Here is an alternate way to traverse the project.

 

 

Message 9 of 11
(4,988 Views)

Nice.

 

I like your way JMota.

0 Kudos
Message 10 of 11
(4,976 Views)