Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using ActiveX Control in MATLAB GUI

6 views
Skip to first unread message

Amine

unread,
Aug 27, 2010, 6:55:28 PM8/27/10
to
Hi,

I´m using an API from a DAQ-Board called DriverLINX as an AcriveX Control in a MATLAB GUI.
This control is dedicated to Visual Basic, but i can call its Methods and properties using the Dot-Notation in a M-File.
My first try with this COM-Interface was to initialize the the Board with a Button in GUIDE, which was succeful, and it looks like this :
------------------------------------------------------------------------------------------------------------
function Initiali_Callback(hObject, eventdata, handles)
global AIsr
AIsr = actxcontrol ( 'DriverLINX.DriverLINXSR', [450,300,1,500]);
%--Methds and Prperties to send--%
set (AIsr,'Req_DLL_name', ' ' );
set (AIsr,'Req_device' , 0 );
set (AIsr,'Req_op' , 'DL_INITIALIZE' ) ;
set (AIsr,'Req_subsystem','DL_DEVICE');
set (AIsr,'Req_mode' , 'DL_OTHER');
AIsr.Refresh
%%----Check for Errors-----%%
set (AIsr,'Req_op','DL_MESSAGEBOX' );
AIsr.Refresh
-----------------------------------------------------------------------------------------------

the Refresh Method tells the ActiveX Control to set all the Properties.
So i need to use this method after each setting, such as Pulse generation.
when I try this method in other Button Callback I get an Error:


------------------------------------------------------------------------
??? Reference to non-existent field 'Refresh'.

Error in ==> DriverLINX>start_pulse_Callback at 188
AIsr.Refresh

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> DriverLINX at 49
gui_mainfcn(gui_State, varargin{:});

Error in ==>
@(hObject,eventdata)DriverLINX('start_pulse_Callback',hObject,eventdata,guidata(hObject))

??? Error while evaluating uicontrol Callback
----------------------------------------------------------------------


can somebody tell me please what i m doing wrong ??
In Visual Basic it is working with the Same way.

0 new messages