Windows Custom Device Driver Control

Hi,
I have written a driver for a device I am making and need to interface the device with MATLAB. Essentially the driver is a kernel mode Windows driver written around WDF. I can already access the driver using the Windows APIs: "GetDevicePath()", "CreateFile()", "WriteFile()" and "ReadFile()" from a C++ program.
So the question is, is there a MATLAB equivalent to the aforementioned functions? If not how is the best way to go about this?
Thanks.

 Respuesta aceptada

Eric Sampson
Eric Sampson el 18 de Mzo. de 2014

1 voto

Hi Tom, my initial thoughts would be to investigate one of the following:
a) write a C/C++ dll API for your driver, and then load it into MATLAB using LOADLIBRARY.
b) write a .NET assembly API for your driver, and then use MATLAB's ability to load .NET assemblies.
c) write a MEX function to control the driver directly via WDF Windows APIs.
I would lean towards option a), because that way you will end up with a C/C++ DLL that you can reuse in other contexts/languages, and calling DLL functions in MATLAB using LOADLIBRARY is very painless.
I hope that helps :)

3 comentarios

Thomas Carpenter
Thomas Carpenter el 18 de Mzo. de 2014
Thanks for tips, I'll have a look into loadlibrary and making a dll.
Thomas Carpenter
Thomas Carpenter el 19 de Mzo. de 2014
Got it working. I've created a DLL wrapper for the driver and have successfully got loadlibrary() and calllib() working. Thanks :)
Eric Sampson
Eric Sampson el 11 de Jun. de 2014
Awesome, thanks for the update! Missed seeing it somehow :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Instrument Control Toolbox Supported Hardware en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de Mzo. de 2014

Comentada:

el 11 de Jun. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by