LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get value of class-element via reference

first, I'm working with a 8.2-version with german interface, so maybe the english terms may not be exact
(well, where's the option to switch over in labview???)

I have a reference to a element of a class and try to have a look at it's data via a property-node of type "value".

reading results in data of type variant, but looking at the data, it doesn't contain the right, but shortened data.

example:

the right data is (directly converted in a variant):
\b\s\80\02\00\00\00\01\000@p\00\1E\00\00\00\00\00\00\14\12BaseObject.lvclass\00\00\rBaseObject\sin\00\01\00\00\00\00\00\03\11\0FInteger.lvclass\00\00\00\00\01\00\00\00\00\00\n\00\01\00\00\00\00\00\07\00\01\00\00\00\00\00\1F\00\00\00\C7\DE\AD\BE\EF\00\00\00\01\00\00\00\07Integer\01\00\00\00\06\00\00\00\1BBaseObject.lvclass:_init.vi\00\00\00\1BSimpleType.lvclass:_init.vi\00\00\00\18Integer.lvclass:_init.vi\00\00\00"BaseObject.lvclass:_baseBuilder.vi\00\00\00\1CInteger.lvclass:Integer.vi:2\00\00\00\07test.viu@\00E\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00\00

the data read via the property node is:
\b\s\80\02\00\00\00\01\00\04\00\00\00\01\00\00\00\00\00\00

so how to get the right data via property-node?
or does it simply not work or maybe there's a bug in the fresh OO-LV?

0 Kudos
Message 1 of 4
(3,097 Views)

hi there

this looks like the short string describes the pure data (the integer/string/double value or whatsever) and the larger string the FULL data, i.e. data types, the class plus the pure data.

difficult to say, so pls post some code/shots



 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 4
(3,089 Views)
outer left there's something like a constructor, which creates an Integer-Object.
the loop now simply shows the actual value of the object and allows to change the value.

until I put the "_setData"-VI beetween the creation and the loop, no value was ever shown.

the _setData-VI is the low-layer method for the setValue-VI, which would be called within the loop.
it searches the RefNum of the Element for the object it gets as parameter, and puts the data into the element via the RefNum and a property-node of type "value".

(there's a _getData-Method, too, which does nearly the same, but it reads the data via a property-node and is the low-layer for "getValue")

so it seems that the data must be explicitly written via property, before it can be read...

maybe there're many thimgs in the behaviour of LabVIEW, which I don't know, yet.

0 Kudos
Message 3 of 4
(3,077 Views)

ooops, something's gone lost, after my session was expired, so here the reply again...
==============================================================

Hi!

sorry, it wasn't quite simple to show all the classes and methods, so I try to simplify the case a bit and now it works.
so I try to re-establish the structure to find the error, but anything I try, the testcase still works, but the real structure does not...
last I changed the initialization in the real structure a bit and now this works, too.

it's a bit strange, the picture attached shows the block-diagram of the test-VI for the real-structure.
(the aim is somewhat more complex than this test-VI...)

outer left there's something like a constructor, which creates an Integer-Object.
the loop now simply shows the actual value of the object and allows to change the value.

until I put the "_setData"-VI beetween the creation and the loop, no value was ever shown.

the _setData-VI is the low-layer method for the setValue-VI, which would be called within the loop.
it searches the RefNum of the Element for the object it gets as parameter, and puts the data into the element via the RefNum and a property-node of type "value".

(there's a _getData-Method, too, which does nearly the same, but it reads the data via a property-node and is the low-layer for "getValue")

so it seems that the data must be explicitly written via property, before it can be read...

maybe there're many thimgs in the behaviour of LabVIEW, which I don't know, yet.

thanks.


0 Kudos
Message 4 of 4
(3,075 Views)