LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How is re-entrancy managed in LVOOP Object Oriented

Hello my fellow LabVillians,

 

I have yet another question from the land of object oriented programming.

 

My application uses multiple serial ports and architecualy it made sense to have a common serial driver object and re-use it around my code.

 

To my surprise, different object instances share (Lock) methods.

My surprise being that this is kind of a fundamental princliple of OOP: Data and Methods Encapsulated within each object.

I guess I understand that that some conditions would need Functional Global Variables,  I had assumed that they weren't possible/Practical in OOP.

 

After I finished having My tantrum and changed the Class .vi to be re-entrant (Share clones is compusory) I found the Following:

 

1. During Deployment I got a "Lost connection with Target"

2. A broken Arrow

3. Soon after a Labview Crash.

 

This is pretty repeatable and incredibly annoying.

 

Anyone else seen similar behavior?

Any one else have an opinion about Object Methods and re-entrancy?

 

LV11sp1

 

Kind Regards,

 

Tim L.

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 1 of 7
(3,194 Views)

I suspect you have some other issue in your code. We extensively use both LVOOP and reentrant methods without any issues. In fact, one of our classes is a communications class which supports serial, parallel, USB, Blue Tooth and TCP interfaces. All of our methods that will not effectively execute immediately such as a methods to set or get an attribute are reentrant.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 7
(3,189 Views)

The code is an override method from an ancestor,

 

 

I changed the re-entrancy in the Ancestor First, Saved, Closed Project, Opened, and hey-presto, it worked.

 

The code is unchanged, The Clue is that Labview Crashed after I did it,

 

My code should not crash the development environment!

 

 

Looks Like Like Labview, Smells like Labview, It's Probably Labview.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 3 of 7
(3,181 Views)

Yes, it is important to remember that reentrancy for class methods must be set for the parent and all it's children classes.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 7
(3,168 Views)

This I knew,

 

The order in which I changed it shouldn't matter and certainly shouldn't crash My Controller and Labview.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 5 of 7
(3,156 Views)
I wrote a communications class hierarchy remarkably similar to what Mark described above. There were never any problems. If you can write a procedure to reproduce this I will try to see if I can duplicate it. I suspect this may turn into a bug report.
=====================
LabVIEW 2012


0 Kudos
Message 6 of 7
(3,141 Views)

Now that it is fixed, there is no way that I want to risk breaking my code again to debug,

I lost an entire day chasing this one down.

 

Sorry, Time is money, I posted here just in case someone else steps in this steaming pile and needs some help

 

LV2011sp1 x86, PXI-8108 in 1052 Combo Chassis. Windows 7 x64,

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 7 of 7
(3,126 Views)