diff options
author | Siddharth11235 | 2019-09-03 18:09:16 +0530 |
---|---|---|
committer | Siddharth11235 | 2019-09-03 18:09:16 +0530 |
commit | b4b6aa36e3486a3544acc52419149b5671f841e9 (patch) | |
tree | 66c1783158f23e6d21c77324156fc57e18d4ac67 /ArduBasicRW.mo | |
parent | f5266f634f4fb4fd39933a83551a01cf446256b8 (diff) | |
download | OpenModelica_HIL-master.tar.gz OpenModelica_HIL-master.tar.bz2 OpenModelica_HIL-master.zip |
Diffstat (limited to 'ArduBasicRW.mo')
-rwxr-xr-x | ArduBasicRW.mo | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ArduBasicRW.mo b/ArduBasicRW.mo new file mode 100755 index 0000000..8637b5e --- /dev/null +++ b/ArduBasicRW.mo @@ -0,0 +1,19 @@ +model ArduBasicRW +import InterProcessCommunication.SharedMemory.*; +Real ModelicaInput; + Real ModelicaOutput (start = 1); + Real OutputDummy; + Real OP (start = 0); + equation + + ModelicaOutput = time; + when sample(0, 0.02) then + + ModelicaInput = InterProcessCommunication.SharedMemory.SharedMemoryRead(1); + OutputDummy = InterProcessCommunication.SharedMemory.SharedMemoryWrite(1, ModelicaOutput); + end when; + OP = ModelicaOutput - ModelicaInput; +annotation( + experiment(StartTime = 0, StopTime = 20, Tolerance = 1e-6, Interval = 0.001)); + +end ArduBasicRW;
\ No newline at end of file |