blob: 8637b5e903f47f759503f6d793e1fc30b1372b33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
|