NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between Execute Steps In-process and Execute Steps in an External instance of LabWindows/CVI TestStand 2014

Hello,


I have a problem with TestStand 2014. I have created a DLL that initiate and reads measurement data from an instrument using COM(ActiveX).
Everything works fine when executing in LabWindows/CVI (2013) / Execute Steps in an External Instance of of LabWindows/CVI .
But when I change to Configure->Adapters->LabWindows/CVI->Configure->Execute Steps in-Process, the program returns error that the driver is not installed or enabled for the instrument using COM.
The ActiveX library functions returns no errors and gives handels for the objects, but when it tries to communicate with the instrument (I guess?) it returns no driver installed.

 

The instrument is a Marposs GagePod, and it is connected to the computer via USB.

 

Regards

 

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

Hi,

 

In Process uses the CVI Run time engine (does not need CVI to be installed)  and for external instance  - CVI development environment will be used.

 

Probably in the run time its not able to find the dependant drivers which is available in the development environment.

 

When you build the DLL you can probably try adding dependant libraries (Add files to DLL - option) and check if it works.

 

Alternatively you can also ask this in the CVI forum.

 

Hope this helps.

 

Ravi

0 Kudos
Message 2 of 12
(5,713 Views)

Hi,

 

You can try the following :

Call your DLL in a STA ( single threaded apartment).

1) In a new sub sequence Copy the step which calls the DLL that you have created.

2) In your main sequence add a sequence call step.

3) Select "Use New thread" option from the Combo box.

4) In the advanced options select the single threaded apartment option.

 

http://forums.ni.com/t5/NI-TestStand/error-not-in-single-threaded-apartment-webbrowser-component-Net...

http://forums.ni.com/t5/LabWindows-CVI/ActiveX-controls-cannot-be-created-in-a-thread-whose-concurre...

 

Hope this helps.

 

Ravi

 

 

0 Kudos
Message 3 of 12
(5,694 Views)

Thanks Ravi, I tried adding the libraries without success unfortunately.

 

I can make an EXE and run it without CVI or Teststand and it works. I suppose the EXE also uses the CVI Run Time engine?

 

Marw

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

Ravi, i have tried to call the DLL in a SAT and it made no difference, same error "Driver not installed or not enabled".

 

CA_GetInterfaceFromObjHandle returns the interface without error.

But when trying to use the object, the object returns "Driver not installed or not enabled". This is only when i run Teststand in In-process.

 

Right now I am clueless...

 

Marw

0 Kudos
Message 5 of 12
(5,636 Views)

I have now compiled the DLL to 64 bit and used it in TestStand 2014 64 bit version, and it works. The test sequence are now able to communicate with the GagePod unit.

Of course I now have other problems, like MS Access is 32 bit and so on...

 

If I use Process Monitor to see what is running in the system when executing 32 bit or 64 bit i can see that one DLL for the GadePod are not present when running 32 bit.  When running 64 bit a process called DrvSurrogate.exe is loading the driver stuff that are missing when running 32 bit.

 

What dose DrvSurogate.exe? Does anyone has any idea why it works in 64 bit but not in 32?

 

Process monitor log when running 64 bit (the stuff that is missing when running 32 bit):Capture.PNG 

 

 

0 Kudos
Message 6 of 12
(5,535 Views)

No idea. The name suggests that it is hosting a driver session in its process. I suspect that it is a 32-bit application that comes with the driver, and the driver uses DrvSurrogate.exe to host the 32-bit session for 64-bit applications.

Scott Richardson
https://testeract.com
0 Kudos
Message 7 of 12
(5,485 Views)

When a 32 bit DllSurrogate is installed you can force it usage also from a 32 bit Client (not only from a 64 bit client) if you create the COM Server Object using the option 

 

CoCreateInstance(..., CLSCTX_LOCAL_SERVER)

 

instead of  CLSCTX_INPROC_SERVER (or any other define that include the CLSCTX_INPROC_SERVER bit like CLSCTX_ALL).

 

This will cause the COM DLL Server to be created inside the declared surrogate as a separate process, using it like an out-of-process COM Server.

 

Using 32bit code and having the CLSCTX_INPROC_SERVER bit set during the CoCreateInstance call, will cause that the COM code that creates and manages objects of this class to load the DLL declared into the InprocServer32 registry entry in the same process as the caller of the function specifying the class context.

 

If you can specify the CLSCTX_LOCAL_SERVER parameter, in that case the behaviour of your 32 bit client will be the same of your 64 bit one.

 

 

 

 

0 Kudos
Message 8 of 12
(5,361 Views)

Hi,

I have a problem with GagePod hardware communication into a new project.

The hardware connect via ethernet and Marposs only send us a cd with drivers library, but no sample program to connect.

 

Can anybody help me????

Thanks!!!

0 Kudos
Message 9 of 12
(3,302 Views)

@Dirizabal  ha scritto:

Hi,

I have a problem with GagePod hardware communication into a new project.

The hardware connect via ethernet and Marposs only send us a cd with drivers library, but no sample program to connect.

 

Can anybody help me????

Thanks!!!


Dear Dirizabal,

the Driver Library CD, once installed, installs both some examples and documentation on how to use the library.


The documentation is available as a PDF manual and also as a set of HTML pages containing some examples in VBScript language that is also used in HTML so that it is also possible to open the source code of the HTML pages to see the usage of the two main COM objects (SMAOMain and SMIOOMain) to acquire the transducer values ​​from the connected electronics.

GagePod is only one of the Marposs electronic boxes that can be connected to the PC, but the interface shown by the SMAO and SMIOO COM libraries is common to all the Marposs boxes .

"Driver Library Development Environment " also installs some running examples in

<installation folder>\Examples

 

showing how to use the Driver Library in:

-Excel

-C #

- HTML

-Visual Basic 6

- MFC C ++


The Driver Library CD installs the examples, the documentation, 2 simulation drivers (to start using the DL without the need to use and connect some real hardware components) and also the runtime of the Driver Library.

Examples and documentation are reserved for the programmer who must develop a customized solution.

The CD cannot be installed on the target PC. Only the runtime must be installed on the target PC: it is available as a standalone installation program in

<installation folder>\Redist\RuntimeSetup.exe

so that only the latter must be distributed with the developed solution.

To use GagePod hw you must also install the specific "GagePod Driver" (both on the developer's PC - if you want to see GagePod in action to test it - and on the target PC where hw will be used) which installs all the files needed to interact with GagePod via the modules SMAO and SMIOO of the Driver Library.

The specific GagePod Driver documentation is installed with its "GagePod Driver" setup.

 

Kind regards,

Andrea.

0 Kudos
Message 10 of 12
(3,292 Views)