LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Another Scripting Headache

The code below finds the Object out and Error out terminals of an accessor VI:

s3.png

It works fine if the scriptor and scriptee are in the same context. If they are in different contexts then it won't find the object output terminal.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 6
(2,175 Views)

Well, since you're clearly only looking for the data type (whether it's an "Object" or something else), could you switch to using the Get Type Information VI instead, and see if it's a "LabVIEW Class instance"?

0 Kudos
Message 2 of 6
(2,125 Views)

Well, I don't know if I would say this was expected, but presumably what's happening is that the variant to data primitive needs to have the actual class loaded in order to do the conversion and that doesn't work because it's another context.

 

Presumably Kyle's suggestion should work for your case and if not, you would need to start dynamically loading the class. I'm not actually sure how you would do that, as I'm assuming Get LV class path won't work and the type parsing VI doesn't seem to return a path. You would probably need to do some work through the other context to get the path, but I haven't tried anything.


___________________
Try to take over the world!
0 Kudos
Message 3 of 6
(2,102 Views)

I don't recall the details, but Control.Terminal.Data Type does sometimes work while Control.Value doesn't. And vice versa. IIRC this was cross-context.

 

I think this bit me once with type defs. And classes are in some ways type defs...

 

It's probably a dead end, but it's a minor change, so you might give it a try.

0 Kudos
Message 4 of 6
(2,077 Views)

Another thought would be to use the connector pane property of the VI, and use that type data to see if it's useful.

 

Assuming you're interested in the CP of course...

0 Kudos
Message 5 of 6
(2,075 Views)

I ended up doing this:

sn.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 6
(2,061 Views)