OPC Server: Start Stop Pause getData(again use) DYMOLA

조회 수: 3 (최근 30일)
shubham kumar gupta
shubham kumar gupta 2020년 11월 16일
I am using a Dymola OPC server
DYMOLA HAS these many tags which can be controlled using SimControl.Run, SimControl.Stop ,etc
here i wrote it in MATLAB
hostInfo = opcserverinfo('localhost');
da = opcda('localhost','Dymosim.OPCServer.1');
connect(da);
fprintf("CONNECTED\n");
grp=addgroup(da,'Demo');
itmIDs={'ModelVariables.Tco','ModelVariables.der(Tco)'};
itm=additem(grp,itmIDs);
area=additem(grp,{'ModelVariables.Area'});
set(grp,'UpdateRate',0.2,'RecordsToAcquire',50);
start(grp);
wait(grp);
[logIDs,Tco]=getdata(grp,'double'); // PREVIOUS ONE
Now I want to change/write value to area so what I did is this
write(area,23);
Now I want to Relog or getdata
NEWTco=read(itm,'device').Value; //using This I can read one instance
[NewlogIDs,NewTco]=getdata(grp,'double');// GIVES ERR

답변 (0개)

카테고리

Help CenterFile Exchange에서 Unified Architecture에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by