LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

pass parameter to functions called from dll

Solved!
Go to solution

Hi All, 

 

I am interfacing a PMC-100 motor controller via Performax protocol using labwindows. 

 

I need to link PerformaxCom.dll explicitly and call some functions from it. I am trying to call this function

 

BOOL fnPerformaxComOpen(IN DWORD dwDeviceNum, OUT HANDLE* pHandle);

- This function is used to open communication with the Performax USB module and to get communication handle. Index number starts from 0.
I tried this way to call another function which just have output and it worked. http://digital.ni.com/public.nsf/websearch/8AE57BDA995ACCB486256AEA0062B3C6?

 

But the problem is that I don't know how to pass parameter to it. 

 

Thanks a lot!

 

Tianchi

 

0 Kudos
Message 1 of 3
(3,432 Views)
Solution
Accepted by topic author paly_Andrew

Tianchi:

 

If you want to explicitly link, you can look at this article: http://zone.ni.com/devzone/cda/tut/p/id/8503

It has a snippet of code which shows passing two parameters to a DLL function.

 

But regarding your statement that "I don't know how to pass parameter to it", in the example you reference, you are passing a parameter: it's just a string constant rather than a variable.

0 Kudos
Message 2 of 3
(3,417 Views)

Hi,

 

Thank you, that link was helpful. I turned out that i didn't typedef the function right. So I could not pass two parameters to the function. 

0 Kudos
Message 3 of 3
(3,394 Views)