G#

cancel
Showing results for 
Search instead for 
Did you mean: 

strange behaviour when creating child in LV2013

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

7.1 -- 2013
CLA
0 Kudos
Message 1 of 6
(8,231 Views)

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

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

Hi

SubPanelBad.JPGSubclassBadDiagram.JPG

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

7.1 -- 2013
CLA
0 Kudos
Message 3 of 6
(6,001 Views)

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

0 Kudos
Message 4 of 6
(6,001 Views)

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

0 Kudos
Message 5 of 6
(6,001 Views)

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

0 Kudos
Message 6 of 6
(6,001 Views)