How to control through opc data access explorer

27 ビュー (過去 30 日間)
Luong Tu
Luong Tu 2016 年 4 月 23 日
コメント済み: Samuel Vergara 2016 年 7 月 3 日
I can not use opc data as a button to capture image, my code is:
da = opcda('localhost', 'KEPware.KEPServerEx.V4');
connect(da);
grp = addgroup(da);
itm1 = additem(grp, 'Channel1.Device1.Group1.capture');
data = read(itm1,'device');
opcdata= data.Value;
if (opcdata==1)
opcdata=0;
vid=handles.vid;
pause(3);
data=getsnapshot(vid);
imshow(data);
savename = strcat('Desktop' ,'hinh', '.jpg');
imwrite(data,savename);
  2 件のコメント
Samuel Vergara
Samuel Vergara 2016 年 7 月 3 日
You got some error that can share? The only thing that I do is use the connect after the item adition, but I'm not sure if it's the solution.
da = opcda('localhost', 'KEPware.KEPServerEx.V4');
grp = addgroup(da);
itm1 = additem(grp, 'Channel1.Device1.Group1.capture');
connect(da);

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNeuroimaging についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by