From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change class <-> interface

Hello,

 

I have some old classes and in lv2020 i need them as interfaces. They have no private data. Is there a way in LV to change lvclass to interface and interface back to lvclass?

 

 

0 Kudos
Message 1 of 6
(3,126 Views)

I don't know what you mean by "interfaces".

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 6
(3,072 Views)

I mean interfaces:

pawhan11_0-1590668783597.png

 

I wanted to convert some classes from 2018 to interfaces in 2020 without recreating all the methods manually.

0 Kudos
Message 3 of 6
(3,065 Views)

@paul_cardinale wrote:

I don't know what you mean by "interfaces".


https://forums.ni.com/t5/LabVIEW/Follow-up-questions-from-quot-G-Interfaces-in-LV-2020-quot/m-p/4043... 


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 4 of 6
(3,060 Views)

From what I can see it doesn't look like you can change a class to an interface easily.  There is an 'Is Interface' property, but it's not writeable, and hand-hacking the xml in the lvclass file is probably non-trivial

 

I've thrown together some scripting that will copy all of the method VIs from a class into an interface which might get you what you need, or at least close enough that tidying things up by hand is possible

 

Class Cloner.png

 

Cheers

Brett

 

 

Senior Software Development Engineer
Certified LabVIEW Architect and LabVIEW Champion
https://theLonelyAnt.com


Message 5 of 6
(2,973 Views)

One other thing, you may need to turn on VI Scripting for this to work - this is in the Options dialog under the Tools menu

 

Options.PNG

Senior Software Development Engineer
Certified LabVIEW Architect and LabVIEW Champion
https://theLonelyAnt.com


0 Kudos
Message 6 of 6
(2,967 Views)