LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

object reference invalid

In my application I want to display the UDP byte data on indicator. I typecast the data read to cluster but property node errors out

1050 oject reference invalid.

Attached is the vi

*************************************************
CLD
*************************************************
0 Kudos
Message 1 of 6
(3,366 Views)

You are not using the property node or a reference to it properly.

 

The property node expects a reference to an object on the front panel.  That is basically just a number that identifies a specific object on the front panel.  I want to say it is a 32-bit number at its heart.  What you are sending it is a bunch of essentially random data and typecasting it to a reference to feed into the property node.  The resulting reference is completely meaningless.

 

In order to truly tell you how to do what you want, we need to see the other end of the UDP connection to determine how the cluster data is being turned into a string.  But in all likelihood, you would want to do something like an Unflatten from String to turn the string data into a cluster which you could than feed into the value property node of a cluster control or indicator.

0 Kudos
Message 2 of 6
(3,356 Views)

Thanks Raven,

 

Using flatten to string does help. Although I am not sure why labview cannot take a complex data structure.

The attach VI has hte sata structure on the FP and the third element is array of structures.

Any suggestion on how to resolve this error?

TIA

 

*************************************************
CLD
*************************************************
0 Kudos
Message 3 of 6
(3,332 Views)

@lvrat wrote:

Thanks Raven,

 

Using flatten to string does help. Although I am not sure why labview cannot take a complex data structure.

The attach VI has hte sata structure on the FP and the third element is array of structures.

Any suggestion on how to resolve this error?

TIA

 


No, after further investigation- I WILL not comment

 

I'll post to get updates on the thread-----\\WHOA- I am curious as to the responses


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 6
(3,321 Views)

@lvrat wrote:

Thanks Raven,

 

Using flatten to string does help. Although I am not sure why labview cannot take a complex data structure.

The attach VI has hte sata structure on the FP and the third element is array of structures.

Any suggestion on how to resolve this error?

TIA

 


What you posted looks okay.

 

Typecast can work with complex data structures.  The problem with yours is that it is too complicated.

 

Typecast won't work on variable length data, which is what you have when you have a pink cluster.  Brown clusters are ones with a known data size.  The reason is that typecast is a very special function that tells LabVIEW to take a fixed number of bytes in memory and reinterpret as a different type of data.  With a pink cluster, you have items that can vary in length such as the arrays.  The data has to contain extra bytes to tell how long an array is.  LabVIEW needs to reinterpret them as something different, but it can never have a clear understanding of how to reinterpret them because the boundary between elements will get blurred.

 

There is nothing to resolve.  Flatten and Unflatten from string are the correct functions to use.  They work because the string contains all the additional data that helps determine how to rebuild the string of data back into a valid datatype.

0 Kudos
Message 5 of 6
(3,314 Views)

Thanks,

________________________________________________________________________________________________________________________________

 Flatten and Unflatten from string are the correct functions to use.  They work because the string contains all the additional data that helps determine how to

rebuild the string of data back into a valid datatype

_________________________________________________________________________________________________________________________________

 

As explained I understand that why typecast will not work. Unflatten from string is also not working. Is there any suggestion to try to get this complex data type to display and useful in LabVIEW?

 

*************************************************
CLD
*************************************************
0 Kudos
Message 6 of 6
(3,286 Views)