From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

invalid reference with open application reference.

Solved!
Go to solution

yahoo2.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I am working with Open Application Reference between a server and a client.
I have to check the status of server side using the disable property or other property of button.

 

To do this, I used a reference indicator and GET method to get the reference in client.

In development environment of LabVIEW 2018, everything is okay.
In runtime engine (.exe application), the reference seemed to be okay because of the same ref. address apparently.

 

However, the property node (here, ClassID) of the reference is not working (error 1055, invalid reference).

I suspect surely the shift register of while loop in client but, I need to use the shift register because final goal is to load by functional global variable.

In other trial, this behavior was the same with functional global variable containing Open(open application reference) and Get(get property node).

 

I enclosed the example code for you and let me know how can I get a valid object reference.
Server: flipping the button
Client: push the update.

Builds: the zipped file includes .exe file. If removed, please compile server and client again.

 

labmaster.

0 Kudos
Message 1 of 6
(1,551 Views)

Roughly thinking, it is right that Invoke Method:Control Value:Get I used cannot handled with memory (reference) in runtime applications.

 

labmaster.

0 Kudos
Message 2 of 6
(1,513 Views)
Solution
Accepted by topic author labmaster

@labmaster wrote:

To do this, I used a reference indicator and GET method to get the reference in client.

In development environment of LabVIEW 2018, everything is okay.
In runtime engine (.exe application), the reference seemed to be okay because of the same ref. address apparently.


When running in the IDE they share the same application context. When you build them into separate executables they do not.

 

References are only valid in the application context they were created in. You can't pass references between two different applications by their underlying numeric value like that.

 

See attached for a working implementation where the client obtains its own reference to the control.

0 Kudos
Message 3 of 6
(1,500 Views)

Thanks for introducing of Open VI Object Reference in VI scripting what I needed.

I have never used the special option.

 

However, the runtime execution is still in trouble after assembling in LabVIEW 2018.

was it okay in your system or can you attach the whole files?

 

labmaster.

0 Kudos
Message 4 of 6
(1,484 Views)

@labmaster wrote:

Thanks for introducing of Open VI Object Reference in VI scripting what I needed.

I have never used the special option.

 


Be careful what you use if you have turned on the scripting option. I believe Open VI Object Reference should work in the RTE, but many scripting functions will not.

 

(BTW, that function was just a useful shortcut. I'm pretty sure that reference can be created in other ways. What you needed was a better understanding of how references work. I hope you understood what I said about application contexts.)

 


@labmaster wrote:

 

However, the runtime execution is still in trouble after assembling in LabVIEW 2018.

was it okay in your system or can you attach the whole files?


 

Can you be more descriptive in what is not working? Are you making sure to start the "server" first?

 

You can try the attached version if you like. I've added some rudimentary error handling and made it behave a bit more like a proper standalone application.

 

(Note: you should always wire your error terminals, especially when building to an executable! The runtime engine does not have automatic error handling.)

 

This and the version I previously uploaded work fine in the runtime engine on my machine.I only have 2020 CE installed on my home computer, but I don't know of any reason that it wouldn't work in 2018. The attached vi is the only one of your files I edited, so I don't know what others would be of use to you.

 

What is your end goal anyway? Why do you need the control reference?

0 Kudos
Message 5 of 6
(1,465 Views)

Thank you for the response.

It was my mistake in previous posting. I checked there is no problem.

However, I understand I can use FP reference even in runtime application. (see the attachment.)

I am not sure which one is the best usually.

 

In my application, the status (ready/running/etc) of application was stored in a button (value and two stepped disable). So I need to read the disable in remote application.

 

labmaster.

 

 

0 Kudos
Message 6 of 6
(1,434 Views)