LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Typecasting message queue data for DQGoop Inheritance

I made a test typecasting message queue data type and tried to access and modify my datas.
 
It works in one way but when I try to copy something into my data labview crash...
 
I guess labview realocates my data space.
 
Does anybody have an idea how to outpass that thing?
 
Pierre
Download All
0 Kudos
Message 1 of 14
(3,317 Views)
Just interested, do you have an idea how to implement virtual functions when using inheritance?
--
Tomi Maila
0 Kudos
Message 2 of 14
(3,308 Views)
Hi

I took a look at your code. The crash happens in the operation where you set value of the DBL in the cluster. I modified the code a little bit to find out why the crash happens. If one makes a copy of the wire coming from Prop. Numerique control, then there is no crashing. This suggest that the crashing happens because the compiler optimises the control flow. Instead of taking a copy of the Prop. Numerique value it uses the reference to Prop. Numerique control value.  This for some reason doesn't work and it's not obvious to me why. My interpretaion may very well be false since I know nothing of the way LV handles queues and clusters.

A non crashing code is attached.

Tomi
--
Tomi Maila
Message 3 of 14
(3,304 Views)
I believe virtual methods can be made using polymorphic VIs but then the question is : how to make labview recognize class hierarchy and ascendants?...
0 Kudos
Message 4 of 14
(3,302 Views)
can you send me the vi saved in 7.1
 
thanks
0 Kudos
Message 5 of 14
(3,302 Views)
7.1 version attached.
--
Tomi Maila
0 Kudos
Message 6 of 14
(3,297 Views)

Ok, you force data copy...

Thanks very much for this help.

Did you heard about Data Queue OOP it seams very powerfull.

http://store.dataact.com/product_info.php?cPath=22&products_id=36

 

0 Kudos
Message 7 of 14
(3,295 Views)
dqGoop is my favorite Goop. But I would still need inheritance and real polymorphism in order to really be able to use Labview for my OO projects.
--
Tomi Maila
0 Kudos
Message 8 of 14
(3,292 Views)

this is just an idea but tell me what you think of this

Pierre

0 Kudos
Message 9 of 14
(3,286 Views)
Your example crashed for me. I suggest you should use flattened strings instead of type cast. I made an example of how to use flattened strings for upcasting and downcasting class member data elements. After I made the example I noticed that it doesn't work with LV 7.1 since flatten to string has different functionality. I also managed to make virtual function calls.

So the LV 8.0 example of data structure that can be used to implement class inheritace are attached.

Also the broken 7.1 version is attached. The rest of the binary string terminal of the Unflatten From String in the middle of the vi should be connected to the unconnected terminal of the Concatenate Strings.

Tomi

--
Tomi Maila
Download All
0 Kudos
Message 10 of 14
(3,266 Views)