27 lines
1.6 KiB
Plaintext
27 lines
1.6 KiB
Plaintext
model test
|
|
Modelica.Blocks.Sources.Sine sine(amplitude = 1) annotation(
|
|
Placement(transformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
EmbeddedControl.Math.DDifference dDifferentiate(x(start = 0)) annotation(
|
|
Placement(transformation(origin = {20, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
EmbeddedControl.Boundary.DAC dac(stepSize = 0.02) annotation(
|
|
Placement(transformation(origin = {60, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
EmbeddedControl.Boundary.ADC adc(stepSize = 0.02) annotation(
|
|
Placement(transformation(origin = {-20, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
Modelica.Blocks.Discrete.Sampler sampler(samplePeriod(displayUnit = "ms") = 0.01) annotation(
|
|
Placement(transformation(origin = {-60, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold(samplePeriod(displayUnit = "ms") = 0.01) annotation(
|
|
Placement(transformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
equation
|
|
connect(adc.y, dDifferentiate.u) annotation(
|
|
Line(points = {{-9, 0}, {7, 0}}, color = {255, 127, 0}));
|
|
connect(sine.y, sampler.u) annotation(
|
|
Line(points = {{-89, 0}, {-73, 0}}, color = {0, 0, 127}));
|
|
connect(sampler.y, adc.u) annotation(
|
|
Line(points = {{-49, 0}, {-33, 0}}, color = {0, 0, 127}));
|
|
connect(dDifferentiate.y, dac.u) annotation(
|
|
Line(points = {{31, 0}, {47, 0}}, color = {255, 127, 0}));
|
|
connect(dac.y, zeroOrderHold.u) annotation(
|
|
Line(points = {{71, 0}, {87, 0}}, color = {0, 0, 127}));
|
|
annotation(
|
|
uses(Modelica(version = "4.1.0")));
|
|
end test; |