From b4b6aa36e3486a3544acc52419149b5671f841e9 Mon Sep 17 00:00:00 2001 From: Siddharth11235 Date: Tue, 3 Sep 2019 18:09:16 +0530 Subject: Pushing entire Modelica HIL Tasks repo --- ArduinoIPCWrite.mo | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 ArduinoIPCWrite.mo (limited to 'ArduinoIPCWrite.mo') diff --git a/ArduinoIPCWrite.mo b/ArduinoIPCWrite.mo new file mode 100755 index 0000000..8b269b4 --- /dev/null +++ b/ArduinoIPCWrite.mo @@ -0,0 +1,19 @@ +class ArduinoIPCWrite + +import InterProcessCommunication.SharedMemory.*; +Real ModelicaInput; + Real ModelicaOutput (start = 1); + Real OutputDummy; + equation + + + ModelicaOutput = sin(time)*100; + when sample(0, 0.005) then + + ModelicaInput = InterProcessCommunication.SharedMemory.SharedMemoryRead(1); + OutputDummy = InterProcessCommunication.SharedMemory.SharedMemoryWrite(1, ModelicaOutput); + + end when; +annotation( + experiment(StartTime = 0, StopTime = 20, Tolerance = 1e-6, Interval = 0.12)); +end ArduinoIPCWrite; \ No newline at end of file -- cgit