05-24-2012 10:31 PM
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.
05-24-2012 11:35 PM
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.
05-25-2012 02:00 AM
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.
05-25-2012 10:27 AM
Yes, it is important to remember that reentrancy for class methods must be set for the parent and all it's children classes.
05-25-2012 06:40 PM
This I knew,
The order in which I changed it shouldn't matter and certainly shouldn't crash My Controller and Labview.
05-26-2012 11:45 AM
05-26-2012 08:59 PM
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,