LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom scripting for pre or post dynamic dispatch vi creation?

Solved!
Go to solution

Hello all,

 

I need to programmatically make cosmetic changes every time a new Dynamic or Static dispatch VI is created in client projects. I have successfully managed to do so for Override and Accessor VIs using custom script but I cannot find any option to do so for dynamic or static dispatch VIs.  Does anyone have deeper knowledge on this topic who could point me in the right direction?  Does anyone know how I can add my own custom VI scripting to VI creation (preferably after Dynamic/Static dispatch vi are created)?  Creation of New VI through right-click on .lvclass item in project explorer would be very desirable too but more important right now are scripting for dynamic/static dispatch VIT. 

 

 

Thank you!

Desi

0 Kudos
Message 1 of 5
(2,856 Views)

Hi Desi,

 

You can change the template that dynamic dispatch VIs are created from. It is in C:\Program Files (x86)\National Instruments\LabVIEW [Version #]\resource\Framework\Providers\LVClassLibrary and open CLSUIP_MemberTemplate.vit. Then edit the VI and resave it as a .vit file with the same name to overwrite the old version. Now your cosmetic changes should appear whenever you create a dynamic dispatch VI. At least, that's an idea, it might not let you do that advanced things you're looking for, but hopefully it helps a bit. I am not sure about static dispatch, I'll see if I can find anything on it.

 

--Hope

Message 2 of 5
(2,799 Views)

Hi Hope,

 

Thank you for your response and details.  I had been using that template but the problem is that I need to programmatically update information on the template every time a new file is created (for eg, client has certain information that needs to be put on the front-panel as simple text decoration, and each file will have different text.)

 

I thought about programmatically altering the VIT when a project starts but that won't work because once the project starts I have no way to update the VIT file or to programmatically make changes to a newly created dynamic/static dispatch files. 😞

 

By the way - Static dispatch VIs use the same template, the connector pane is programmatically altered accordingly.  Even if I find out where, I can maybe insert some of my own custom scripting there since I'm only doing cosmetic changes!

 

Thank you again,

Desi

0 Kudos
Message 3 of 5
(2,795 Views)
Solution
Accepted by topic author Embedded_Desi

Perhaps you could try making a QuickDrop shortcut and just always running the shortcut every time you create a dynamic or static dispatch VI? It's not ideal since you'd have to remember to do it every time, but that's all I can think of. Then you could put all the scripting code you need in the shortcut to add the text decorations and stuff like that.

Message 4 of 5
(2,788 Views)

That is an excellent suggestion, I didn't think of it earlier. True, that wouldn't be ideal but it may work as an alternate solution. Since we only have to do the cosmetic update once when a VI is generated I think this might be an acceptable route.

 

Thank you again, I'll accept your suggestion as a solution for now (but if anyone has the inside knowledge on where I can plug the script for automated scripting per my original question, please do share.)

 

Regards,

Desi

 

 

0 Kudos
Message 5 of 5
(2,785 Views)