필터 지우기
필터 지우기

How can I read handles data in opc callback function

조회 수: 2 (최근 30일)
Luong Tu
Luong Tu 2016년 5월 17일
Hi! I am writing an OPC callback function in matlab! I have a trouble that my OPC callback function can not read the handles data, but the other button callback function can read it. What is the error, please help me, m code is: try handles.data = addgroup(handles.da); handles.dataIDS = {cambien1}; handles.data_itm = additem(handles.data,handles.dataIDS); guidata(hObject, handles); set(handles.data,'DataChangeFcn',{@Data_Group_Callback,handles},'UpdateRate',0); end my Data_Group_Callback function if(handles.data_itm.value==1) axes(handles.capture); vid=handles.vid; pause(3); data=getsnapshot(vid); imshow(data); savename = strcat('doan' ,'hinh', '.jpg'); imwrite(data,savename); x = get(handles.x,'value'); if x==1
axes(handles.processing); RBG = imread('doanhinh.jpg'); bw = imsubtract(RBG(:,:,1), rgb2gray(RBG)); % Convert the resulting grayscale image into a binary image. bw = im2bw(bw,0.18); % Remove all those pixels less than 300px bw = bwareaopen(bw,30);...... my button call back is function red_Callback(hObject, eventdata, handles) % hObject handle to red (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) handles.x=1; guidata(hObject,handles); can not use the handles.x in the function Data_Group_Callback(hObject, eventdata, handles)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Server Connection and Browsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by