How to call dll from GUI????

Hi,
we created dll for simulink model., Now we are trying to call the dll from GUI but its not taking the command.,
if not(libisloaded('TOLI_win32'))
hfile = 'Tolidll.h';
libfile='TOLI_win32.dll';
loadlibrary(libfile,hfile);
end
libfunctionsview TOLI_win32;
calllib('TOLI_win32','TOLI_initialize',1);
we gave command like this., But its not taking., This method is corerct pls help us in ressolving this issue?

댓글 수: 4

Kaustubha Govind
Kaustubha Govind 2013년 5월 17일
Please specify what error messages you see, or explain what you mean why "its not taking".
vinothkannan K
vinothkannan K 2013년 5월 21일
@ Kaustubha Govind : Actually we developed one sample model, If we are selecting check box means it should update edit box as 1, for same model we created dll., but now if am selecting check box means its not updating..
Kaustubha Govind
Kaustubha Govind 2013년 5월 21일
How does the model update the edit box? What exact commands do you use to do that?
vinothkannan K
vinothkannan K 2013년 5월 22일
편집: vinothkannan K 2013년 5월 22일
This are the commands we are using, We are calling this (IFM_Select_fcn) function from tlc using FEVAL.
function select = IFM_Select_fcn
persistent h;
if isempty(h)
h = guidata(Tolisys);
end
select = get(h.IFM_Select, 'Value');
if (select)
set(h.IFM_Mode, 'String', 2);
else
set(h.IFM_Mode, 'String' ,0);
end

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

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 5월 22일

0 개 추천

I presume that this is a follow-up question from your (colleague's previous question) here. As I mentioned in my comment on that question:
[T]hat would make your output be a constant value received from the GUI at the time of code-generation - is this what you want? In that case, simply put your code to invoke the GUI into a helper MATLAB function and call it using FEVAL.
The code-generated from the S-function essentially just returns a constant output which is equal to the value of the checkbox at the time of code-generation. It doesn't actually evaluate the function IFM_Select_fcn. Note that it is not possible to generate standalone C code from MATLAB code that involves GUI operations. Perhaps you should explain more about why you even want to have a DLL do this for you, when you can simply write MATLAB code to do what you need (since you're calling the DLL from MATLAB anyway).

댓글 수: 3

vinothkannan K
vinothkannan K 2013년 5월 23일
Now just for testing purpose we are calling dll from Matlab.
Kaustubha Govind
Kaustubha Govind 2013년 5월 23일
What is the final intended application for the DLL?
vinothkannan K
vinothkannan K 2013년 5월 23일
We have to create .exe for our model, It should work with out matlab also..

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

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

질문:

2013년 5월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by