Skip to content

Commit 19e43a1

Browse files
committed
Add start and fixed attributes to Get models of SerialPackager
See modelica/Modelica_DeviceDrivers/#69
1 parent af901c6 commit 19e43a1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Modelica_DeviceDrivers/Blocks/Packaging/SerialPackager.mo

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,7 @@ and one Integer value is added, serialized and finally sent using UDP.
463463
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
464464
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
465465
parameter Integer n = 1 "Vector size";
466-
Modelica.Blocks.Interfaces.BooleanOutput y[
467-
n]
466+
discrete Modelica.Blocks.Interfaces.BooleanOutput y[n](each start=0, each fixed=true)
468467
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
469468
protected
470469
Integer y_int[n];
@@ -484,7 +483,7 @@ and one Integer value is added, serialized and finally sent using UDP.
484483
end when;
485484

486485
for i in 1:n loop
487-
y[i] = if (y_int[i] == 1) then true else false;
486+
y[i] = if (y_int[i] == 1) then true else false;
488487
end for;
489488

490489
annotation (Icon(graphics={
@@ -511,7 +510,7 @@ and one Integer value is added, serialized and finally sent using UDP.
511510
import Modelica_DeviceDrivers.Utilities.Types.ByteOrder;
512511
parameter Integer n = 1 "Vector size";
513512
parameter ByteOrder byteOrder = ByteOrder.LE;
514-
Modelica.Blocks.Interfaces.IntegerOutput y[n]
513+
discrete Modelica.Blocks.Interfaces.IntegerOutput y[n](each start=0, each fixed=true)
515514
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
516515
protected
517516
Real dummy;
@@ -554,7 +553,7 @@ and one Integer value is added, serialized and finally sent using UDP.
554553
import Modelica_DeviceDrivers.Utilities.Types.ByteOrder;
555554
parameter Integer n = 1 "Vector size";
556555
parameter ByteOrder byteOrder = ByteOrder.LE;
557-
Modelica.Blocks.Interfaces.RealOutput y[n]
556+
discrete Modelica.Blocks.Interfaces.RealOutput y[n](each start=0, each fixed=true)
558557
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
559558
protected
560559
Real dummy;
@@ -601,7 +600,7 @@ and one Integer value is added, serialized and finally sent using UDP.
601600
import Modelica_DeviceDrivers.Utilities.Types.ByteOrder;
602601
parameter Integer n = 1 "Vector size";
603602
parameter ByteOrder byteOrder = ByteOrder.LE;
604-
Modelica.Blocks.Interfaces.RealOutput y[n]
603+
discrete Modelica.Blocks.Interfaces.RealOutput y[n](each start=0, each fixed=true)
605604
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
606605
protected
607606
Real dummy;
@@ -645,7 +644,7 @@ and one Integer value is added, serialized and finally sent using UDP.
645644
import Modelica.Utilities.Strings.length;
646645
parameter Integer bufferSize = 40
647646
"Buffer size (in bytes) reserved for String (ensure that same buffer size is used in corresponding AddString block!)";
648-
output String data;
647+
discrete output String data(start="", fixed=true);
649648
protected
650649
Real dummy;
651650
equation

0 commit comments

Comments
 (0)