summaryrefslogtreecommitdiff
path: root/ArduinoIPCWrite.mo
diff options
context:
space:
mode:
authorSiddharth112352019-09-03 18:09:16 +0530
committerSiddharth112352019-09-03 18:09:16 +0530
commitb4b6aa36e3486a3544acc52419149b5671f841e9 (patch)
tree66c1783158f23e6d21c77324156fc57e18d4ac67 /ArduinoIPCWrite.mo
parentf5266f634f4fb4fd39933a83551a01cf446256b8 (diff)
downloadOpenModelica_HIL-b4b6aa36e3486a3544acc52419149b5671f841e9.tar.gz
OpenModelica_HIL-b4b6aa36e3486a3544acc52419149b5671f841e9.tar.bz2
OpenModelica_HIL-b4b6aa36e3486a3544acc52419149b5671f841e9.zip
Pushing entire Modelica HIL Tasks repoHEADmaster
Diffstat (limited to 'ArduinoIPCWrite.mo')
-rwxr-xr-xArduinoIPCWrite.mo19
1 files changed, 19 insertions, 0 deletions
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