LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

to more specific class - cursor reference - error 1057

I must be missing something very stupid here. Why is this cast not working? Thanks!

 

weird cursor cast error.JPG

0 Kudos
Message 1 of 12
(4,492 Views)
I don't understand what you are doing. Why are you casting the references to generics and then back to what they were originally?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 12
(4,483 Views)
Also, does the cursor exist?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 12
(4,482 Views)

I do not know why it happens, but why would you want to to cast to a generic refnum and then back to the cursor refnum?

 

I suspect that you lose some information when going to the generic refnum. That lost information then does not allow the cast to the more specific cursor reference.

 

Lynn

0 Kudos
Message 4 of 12
(4,481 Views)
One more thing. Are you getting any other errors along the way? The error that you are seeing is probably not the first one to be generated but you don't have the error clusters connected up.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 12
(4,477 Views)

Obviously, this VI is not the VI that stimulated this question. I have a much more elaborte setup where I pass generic references to a thread and then cast them back to their original types. I'm simply demonstrating the behavior and wish to understand it. As demonstrated (and as you would expect), I cast the graph reference to and from a generic reference with no error, but I can't do this with the cursor reference. Maybe I'm missing something obvious but I don't understand why this cast isn't allowed. Is there a place in Labview help that describes which references can be cast between more generic types and back down?

0 Kudos
Message 6 of 12
(4,474 Views)
There are other questions to be answered:

1. Does the cursor exist on the graph?
2. What other errors are you getting earlier in the process?
3. Have you tried probing the cursor reference before you did the cast to a generic type?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 12
(4,471 Views)

It's the only error. I can actually get the class id of the cursor before it is generic, then after it's generic. But when I try to make it more specific, it fails to do so. As you can see in the following (and in the original), the cursor exists and should be readable.

 

weird cursor cast error 2.JPG

0 Kudos
Message 8 of 12
(4,470 Views)

What I am about to suggest is a workaround to be considered a last resort.  Try Type Casting the reference instead. 

0 Kudos
Message 9 of 12
(4,451 Views)
Excellent point Darin! I forgot until you mentioned it, but I once had to do that as a workaround when working down inside the guts of the project API somewhere.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 12
(4,434 Views)