NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

dll calling problem

Solved!
Go to solution

I'd like to use .dll files which were developed for another application.

I'm using TS 4.0 which is recognising dll's function but when try to run it it's not working.

I thought it won't be so straightforward, I attached specify module part.

Any help would be appreciated.

Thanks

0 Kudos
Message 1 of 7
(4,202 Views)

It is quite difficult to provide a solution to your problem as you missed to tell us what kind of error you get.
My guess: Your functions take parameters and you did not specify any.

0 Kudos
Message 2 of 7
(4,177 Views)

Thanks Guenter for your reply.

It looks like the "DllInit" function is partly working.

The dll called function is starting, but immediately closing down.

I tried to change the unload options, but nothing has changed.

Another question is: how to give parameters to the dll.

In the original application it looked like this:

        csAudio.dll,LOADPRESET wattmeter.atp
        csAudio.dll,SHOWDIA
        csAudio.dll,STARTMEAS
        csAudio.dll,MBOK, ...

0 Kudos
Message 3 of 7
(4,164 Views)

Do you have a specification of this DLL's functions?  This should clarify the parameter(s) each function takes.

How parameters are passed to a DLL in TestStand can be taken from the examples that ship with TestStand.

Guenter

0 Kudos
Message 4 of 7
(4,150 Views)

Dear kopisti,

Rearding we talked over phone about this problem, let me share the current state in nutshell also on this forum:

The dll you use doesn't contain the prototype of the functions. Like: int func(int a, int b ...) So we don't know any parameters about how to call those 4 functions: CallAT(), EntryPoint(), DllInit(), DllFree()

 

Since the TestStand is a very flexible environment, you can provide this prototypes manually by adding those parameters in dll module.

If you could reach somehow the documentation of the Dll, it's very strait forward to do it, and any case we can provide you help. Maybe you can also ask for support by the developer company of the Dll, or the developer of the old test-program which called this dll.

 

We also mentioned that this Dll is possibly an interface to reach a ActiveX/COM Server. By-passing this dll you can also use ActiveX/COM TestStand module to call directly the ActiveX functionality.

 

Feel free to contact us in any progress or questions on this topic, and/or share with public here in the forum your knowledge.

 

Best Regards:

Tamas Szekely

Applications Engineer Hungary - National Instruments

0 Kudos
Message 5 of 7
(4,109 Views)
Solution
Accepted by topic author kopisti

Dear All,

 

Thank you for your effort trying to help me out and find a solution.

In the meantime the problem has been solved.

The csAudio.dll was an interface between the original application and a DLL which has the full function as an executable.

I didn't see this at the first time, as I could see only csAudio.dll.

The other DLL (an audiotester) has a function that uses parameters. One of them is a pointer to a zero terminated string (CString).

The other two:

- ReceiveBuffer is a passed variable which will be filled by the DLL and contains results from
the DLL.

- ReceiveBufferLen is an integer variable which contains the length of the string buffer.
The result of the DLL should be zero.

 

The only problem still exist is that if I call this DLL to stop TestStand freezes.

So I skipped this step and it looks like TS closes and unload the DLL's function when sequence finished.

 

Best regards,

 

kopisti

Message 6 of 7
(4,078 Views)

I am using adlink PCI 7841, i am getting "build error" when i tried to create a dll ,please help me 

 

error which i got

Error 1 occurred at AB_Destination.lvclass:Copy_File.vi -> AB_Source.lvclass:Copy_SourceItem.vi -> AB_Build.lvclass:Copy_Files.vi -> AB_Application.lvclass:Copy_Files.vi -> AB_DLL.lvclass:Copy_Files.vi -> AB_Build.lvclass:Build.vi -> AB_Application.lvclass:Build.vi -> AB_DLL.lvclass:Build.vi -> AB_Build.lvclass:Build_from_Wizard.vi -> AB_UI_Frmwk_Build.lvclass:Build.vi -> AB_UI_FRAMEWORK.vi -> AB_CreateNewWizard_Invoke_CORE.vi -> DBUIP_CreateNewWizard_Invoke.vi -> DBUIP_CreateNewWizard_Invoke.vi.ProxyCallererror.JPG

0 Kudos
Message 7 of 7
(3,896 Views)