09-24-2013 09:29 AM
Hi
I noticed the following strange behaviour when creating a child class.
Using LV2013. G# is installed via the "official" download via VIPackage manager.
I have a very old class to handle subpanels.
For reasons I cannot recall the Create method has instead of a class input on the connector a class constant inside the vi.
Now I wanted to create a child-class to handle specific subpanel-insert issues.
LV 2013 just ignores the fact, that it cannot instantiate a mother-class-instance.
It opens an extra lvlib-window but everything seems to be all right.
LV2012 was still trying to to insert the (obiously broken) creator of the mother class.
Now that I know how to handle this, it's ok. But it took some time.
Gabi
09-25-2013 01:01 AM
Hi Gabi
Could you give an example on what the solution is, just in text? We are switching to LV2013 soon and I would like to ahead of som of the problems using OOP in LV. Is the problem only observed with the G# tool?
/Christian
09-25-2013 11:00 AM
Hi
it is pretty simple.
If do not modify the standard creator, like I must have done many months ago, all should be OK.
Since I rarely use NI-Classes I can only report on the G# flavor.
I have added two screen shots and hope this explains it somehow.
Regards, Gabi
09-26-2013 07:04 AM
Hi Gabi
We have recently shifted from LV2012 to LV2013 on a large scale project using G#, but can not see this happening anywere.
Is this problem consequent in other classes aswell, apart from the subpanel handling class, in your project/environment when you try to make a subclass?
We can't seem to recreate the problem
Regards,
Patrik
09-26-2013 07:19 AM
Hi Guys!
My guess is the following:
The first class constructor (SubPanel.lvclass::SubPanel_create.vi) has a "faulty" connector pane. To make G# work it is required that the constructor has a lvclass reference, "reference in", bound to the top left connector (from what I can see from the screendumps it is on the blockdiagram and somewhere on the front panel but not bound to the connectorpane).
When creating a subclass to SubPanel.lvclass G# IDE tries to insert or replace the parent class into the child class constructor. Since the parent class is faulty (connector pane is not wired correctly) it cannot do this which results in a faulty execution.
There could be a difference in how LV2013 and other LabVIEW versions are handling this scripting error or there could be some changes in how G# Ide interpretes the error.
However, the parent class SubPanel.lvclass::SubPanel_Create.vi is considered "broken" if it has this connectorpane construction.
So, this is not related to LabVIEW versions but to a unlucky situation in the constructor. Fix the constructor and it should work fine.
Good luck!
Andreas
09-26-2013 07:40 AM
There has been some threads about the connector pane earlier, and as i recall the way of setting the connectorpane changed in erlier versions of G#. It also gives some information on why the 6x4x4x6 pattern is mainly used.
https://decibel.ni.com/content/thread/18090?tstart=0
//Patrik