LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling ActiveX server invocation

Hello -

 

I've used the CVI (2012 SP1) "Create ActiveX Server" tool to create a server, and have also used the "Create ActiveX Controller" tool to produce the companion controller code. All of this seems to be working. However, I'm wondering about controlling server invocation. I notice that the server is invoked automatically when a corresponding controller library "New" method is invoked to obtain an object handle. If I start the server from a Windows command shell, then start a test that uses the controller library, a new copy of the server is started (the running server is ignored). Is there any way to direct the client code / controller library to use the already-running server instead of starting a new one? The help for the controller "New" methods says:

 

"If the server application is already running, this function may or may not start another copy of the application.  This is determined by the server application."

 

Can I use the CVI ActiveX server tools to configure the server for the desired behavior, then? I don't notice anything among the obvious configuration options that seems to address this behavior.

 

Thanks in advance!

 

--Barry

 

0 Kudos
Message 1 of 12
(5,016 Views)

Hey Barry, 

 

What particular behavior are you trying to obtain? Is it possible for you to process multiple objects per invocation? 

0 Kudos
Message 2 of 12
(4,993 Views)

Hi, Haley -

 

The desired behavior would be for the client code to bind to the already-running server application rather than starting a new copy of the server. We'd like to be able to start the server from the command line and have this become the one and only active server.

 

Regarding your question about processing multiple objects, I'm not sure if this applies. Our server implements multiple interfaces and the same number of objects, with a one-to-one mapping between interfaces and objects. The server interface methods don't really do any object processing, per-se, I think; the object handle received by these methods is not used. I'm not sure I'm answering your question - let me know if I can clarify further.

 

Barry

 

0 Kudos
Message 3 of 12
(4,987 Views)

Hey Barry,

 

From what I understood you are just trying to bind to the already created server (ie, you don't want to create another copy of the server). IS this correct? If so, I will look into this and see what I can find to help you resolve this. 

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 4 of 12
(4,957 Views)

Hi, Rob. Yes, I think you have it exactly. Thanks in advance!  --Barry

0 Kudos
Message 5 of 12
(4,947 Views)

Hey Barry,

 

As you stated before, "If the server application is already running, this function may or may not start another copy of the application.  This is determined by the server application." I'm going to have to try creating a new server application to poke around. I know you've already poked around to find the configuration, but I'll double check to see what I can find. It might take me a bit, but I'll let you know. Thanks

 

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 6 of 12
(4,913 Views)

Much appreciated, Rob.  --Barry

0 Kudos
Message 7 of 12
(4,907 Views)

Barry,

 

Would it be possible to post some screen shots of what your Server Setup looks like? You should just be able to go to Tools>>Edit ActiveX Server and take the screen shots of the Server Settings (e.g. the server name, type, etc...) and one of the Advanced Options tab you can open from the Server Settings. This would help me to double check and make sure I'm getting the same behaviour. 

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 8 of 12
(4,897 Views)

Hi, Rob -

 

I'm attaching the requested screenshots. Let me know if I can provide anything further.

 

Barry

 

Download All
0 Kudos
Message 9 of 12
(4,853 Views)

After poking around in the code, this function might be where you need to make the changes, or around there. The configuration boxes look like they don't have the option to make the changes you requested, therefore we could try diving into the code created when we make the server. 

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 10 of 12
(4,810 Views)