# Calling a dll from Mathematica

I would like to call the following function from Mathematica

ps3000aOpenUnit
PICO_STATUS ps3000aOpenUnit
(
short * handle,
char * serial
)


I define the DLLFunciton in Mathematica:

ps3000OpenUnit =  DefineDLLFunction["ps3000aOpenUnit", "PS3000a.dll", "short", {"short[]", "char[]"}]


I get following error when executing

ps3000OpenUnit[handle, serial]
NET::methodargs: Improper arguments supplied for method named ps3000aOpenUnit.


What is wrong with my code?

Thanx for helping me in advance.

• I don't recall "short" or "char" being a valid type for the definition - shouldn't they be "integer" and "string" (or "char*"? – ciao Jun 5 '14 at 7:52
• It seems like your function signature declares your parameters as pointers, but in your DefineDLLFunction you specify arrays. What are the values of handle and serial? – mfvonh Jun 5 '14 at 14:03

ps3000aOpenUnit =