LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV2015 OOP - accessor names of children, character lineator

Dear NI enthusiasts,

 

(This is my first post, so please be easy on me and tell me if it needs to be moved or changed)

 

I'm fairly new to OOP and am currently developing a JSON serialization/deserialization scheme using the Character-Lineator in order to create a LV-Lua API.

I'm hoping to achieve a very generic/reusable approach and hence have folowing inheritance structure:

 

Serializable.lvclass

-> JSON Value.lvclass

     -> JSON String.lvclass

     -> JSON Number.lvclass

     -> JSON Boolean.lvclass

     -> JSON Null.lvclass

     -> JSON .... .lvclass

 

So JSON Value inherits from Serializalbe and the other childer (Number,String....) inherit from "JSON Value". Now in each I have a "type" and a "value" key:value pair in form of a JSON object.

 

So much to the setup here comes my problem:

Everytime I try to create an accessor for a child class (e.g. value) and have the same name in the control as the parent class uses, even though It should be created in a seperate namespace (its own class scope), Labview crashes with a "Nonexecutable exception".

 

I've managed to rename the controls item so that it is not the same and create the accessor without any problems. My question is:

Is there any explanation to why I can't use the same name in the childrens control? (Please don't just comment with "Just don't do that")

 

Best regards,

Serj

"Anything can be done if you only think about it hard enough..."
"... truth is a lie in disguise!"
0 Kudos
Message 1 of 4
(3,322 Views)

Hi Serj,

 

could you add a small example VI that illustrates what you are doing,

together with instructions (like rename object xy to ... to reproduce the crash)?

 

This would be great!

 

Regards,

Stephan

0 Kudos
Message 2 of 4
(3,212 Views)

Hi skerl!

 

Thanks for your reply.

 

I'm currently unable to produce the error in a small project using the same inheritance specs (which is a drag).

 

The main project where this issue occurs is too large to be uploaded or partitioned sensibly. Possibly LV dies because it has to recompile all classes when the control is changed (currently 400 classes in the project)

 

I appreciate your helpfull suggestion.

 

 

"Anything can be done if you only think about it hard enough..."
"... truth is a lie in disguise!"
0 Kudos
Message 3 of 4
(3,191 Views)

Hi Serj,

 

You can create a directory on disk named the same as the LabVIEW class to save the class library file, class member VIs, and class custom default probes. You can include the files that the class library owns in the directory. If you include files for more than one class library in the same directory, conflicts might occur if you try to include VIs of the same name in different class libraries. Naming conflicts can occur in the development process when you override dynamic member VIs.

 

I found that in the creating LabVIEW classes manual:

 

Creating LabVIEW Classes - LabVIEW 2011 Help - National Instruments
https://www.ni.com/docs/en-US/bundle/labview/page/creating-labview-classes.html

 

Maybe this helps you answer  your questions.:)

 

Regards,

Stephan

0 Kudos
Message 4 of 4
(3,118 Views)