DYMOLA: opc server how to initialize using dsin.txt or a mat file using MATLAB

若如初见. 提交于 2021-02-17 05:52:07

问题


I created an OPC server in DYMOLA, now I have this in DYMOSIM to click and initialize

using a ".MAT" file of a dsin.txt

Now I created a GUI file in MATLAB, and take input for variables and created a mat file

>>save FLUID_INITIALISE area volume density

Now I want to initialize this using MATLAB

I can do this

>>write(Initialize,1) //To initialize a previous data

I know can do this using dymola , SIMULATION > CONTINUE > IMPORT

BUT I WANT TO INITIALIZE IT USING MATLAB

normal MAT FILE LOOKS LIKE THIS

Aclass=['Atrajectory';'1.1        ';'           ';'binTrans   '];
data_1=[0,3600;100,100;50,50;5,5;100,100;90,90;10,10;10,10;10,10;10,10;10,10];
data_2=[];
dataInfo=[0     1     1     1     1     1     1     1     1     1     1     2     2;
         1     2     3     4     5     6     7     8     9    10    11     2     3;
         0     0     0     0     0     0     0     0     0     0     0     0     0;
        -1     0     0     0     0     0     0     0     0     0     0    -1    -1;];          
description=['TFFTTTHAVDS  ';'ieeeeeeroep  ';'meemmmaelne  ';'eddppptausc  ';'        mii  ';'ichchht[etf  ';'nooooorm yi  ';' ltltta^[ c  ';'[d d  n2m[   ';'s i ios]^kH  ';']ininuf 3ge  ';' n/n te ]/a  ';' /o [ r  mt  ';' ou[K[   ^   ';' utK]Kc  3[  ';' t ] ]o  ]J  ';'  [   e   k  ';' [k   f   g  ';' kg   f   ^  ';' g/   i   -  ';' /h   c   1  ';' h]   i   K  ';' ]    e   -  ';'      n   1  ';'      t   ]  ';'             ';'      [      ';'      k      ';'      g      ';'      /      ';'      K      ';'      m      ';'      ^      ';'      2      ';'      s      ';'      ^      ';'      2      ';'      ]      '];
name=['TFFTTTUAVDCTd';'ichchh roepce';'miiiio eln or';'e      aus  (';'        mi  T';'        et  c';'         y  o';'            )'];
save INITIALIZER Aclass data_1 data_2 dataInfo description name;

回答1:


To solve this issue what I did is,

I initialized dymola with default dsin.txt [which is created once you click simulate button]

then I write new values to them using this

write(area,20);
write(volume,30); 

.. etc

Now

write(Run,1)


来源:https://stackoverflow.com/questions/64881470/dymola-opc-server-how-to-initialize-using-dsin-txt-or-a-mat-file-using-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!