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

4 visualizaciones (últimos 30 días)
shubham kumar gupta
shubham kumar gupta el 16 de Nov. de 2020
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

Respuestas (0)

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by