필터 지우기
필터 지우기

Using windows messages to interface with data acquisition

조회 수: 1 (최근 30일)
Stefan
Stefan 2012년 12월 13일
Hello,
We are trying to build a Matlab GUI that interfaces with a custom instrument. We have a DLL that handles data acquisition for this instrument, and which posts a windows message to a user-defined Window handle when there is data available for retrieval.
Is it possible to catch this Windows message in Matlab and activate a callback that will communicate with the instrument DLL (using calllib) then store the data in one of the global variables in the main GUI code for display/processing/storage (the data display/processing/storage would be handled by timers or clicking other buttons on the main Matlab GUI).
Thank you, Stefan

답변 (2개)

Jing
Jing 2012년 12월 13일
I think if the Windows message is a output of DLL, MATLAB sure can accept the output, but how to activate certain callback using this output will be more tricky.

Philip Borghesani
Philip Borghesani 2012년 12월 14일
편집: Philip Borghesani 2012년 12월 14일
To do this you will need a mex or loadable c function that creates a dummy window that can receive the messages and does the needed setup for the notifications. Doing this correctly is quite a bit of work I suggest using the Data Acquisition toolbox if it supports your hardware.
  댓글 수: 1
Stefan
Stefan 2012년 12월 14일
Thanks for the suggestion. Do you know of any example code for the mex function? DAQ toolbox would be difficult because even though the actual DAQ card is supported, the DLL that we have already handles quite a bit of signal post-processing and is also part of the instrument control loop, plus it contains low-level work arounds for bugs in some of the data acquisition hardware itself that have never been fixed by the original vendor.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by