Skip to content

Commit ae7dc01

Browse files
committed
1 parent 57a9e3e commit ae7dc01

File tree

19 files changed

+109
-109
lines changed

19 files changed

+109
-109
lines changed

Blocks/Communication.mo

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package Communication
66
extends Modelica_DeviceDrivers.Utilities.Icons.BaseIcon;
77
extends Modelica_DeviceDrivers.Utilities.Icons.SharedMemoryIcon;
88
import Modelica_DeviceDrivers.Packaging.SerialPackager;
9-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
9+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
1010
import Modelica_DeviceDrivers.Communication.SharedMemory;
1111
import Modelica_DeviceDrivers.Communication.SharedMemory_;
1212
parameter Real sampleTime=0.01 "Sample time for input update";
@@ -28,7 +28,7 @@ package Communication
2828
Integer bufferSize;
2929
equation
3030
when (initial()) then
31-
bufferSize = if autoBufferSize then alignAtByteBoundery(pkgOut.autoPkgBitSize)
31+
bufferSize = if autoBufferSize then alignAtByteBoundary(pkgOut.autoPkgBitSize)
3232
else userBufferSize;
3333
pkgOut.pkg = SerialPackager( bufferSize);
3434
sm = SharedMemory(memoryID,bufferSize);
@@ -104,7 +104,7 @@ provided by the parameter <b>memoryID</b>. If the shared memory partition does n
104104
extends Modelica_DeviceDrivers.Utilities.Icons.BaseIcon;
105105
extends Modelica_DeviceDrivers.Utilities.Icons.UDPconnection;
106106
import Modelica_DeviceDrivers.Packaging.SerialPackager;
107-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
107+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
108108
import Modelica_DeviceDrivers.Communication.UDPSocket;
109109
parameter Real sampleTime=0.01 "Sample time for input update";
110110
parameter Boolean autoBufferSize = true
@@ -126,7 +126,7 @@ provided by the parameter <b>memoryID</b>. If the shared memory partition does n
126126
UDPSocket socket;
127127
equation
128128
when (initial()) then
129-
bufferSize = if autoBufferSize then alignAtByteBoundery(pkgOut.autoPkgBitSize)
129+
bufferSize = if autoBufferSize then alignAtByteBoundary(pkgOut.autoPkgBitSize)
130130
else userBufferSize;
131131
pkgOut.pkg = SerialPackager( bufferSize);
132132
// Modelica.Utilities.Streams.print("Open Socket "+String(port_recv)+" with bufferSize "+String(bufferSize));
@@ -207,7 +207,7 @@ provided by the parameter <b>memoryID</b>. If the shared memory partition does n
207207
"A block for receiving serial datagrams using the serial interface"
208208
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPortIcon;
209209
import Modelica_DeviceDrivers.Packaging.SerialPackager;
210-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
210+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
211211
import Modelica_DeviceDrivers.Communication.SerialPort;
212212
import Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate;
213213
parameter Real sampleTime=0.01 "Sample time for input update";
@@ -236,7 +236,7 @@ provided by the parameter <b>memoryID</b>. If the shared memory partition does n
236236

237237
equation
238238
when (initial()) then
239-
bufferSize = if autoBufferSize then alignAtByteBoundery(pkgOut.autoPkgBitSize)
239+
bufferSize = if autoBufferSize then alignAtByteBoundary(pkgOut.autoPkgBitSize)
240240
else userBufferSize;
241241
pkgOut.pkg = SerialPackager(bufferSize);
242242
// Modelica.Utilities.Streams.print("Open Socket "+String(port_recv)+" with bufferSize "+String(bufferSize));
@@ -563,7 +563,7 @@ so that you end up with the following directory tree:
563563
564564
<p>
565565
Finally, note that in order to translate and execute Modelica models utilizing this API it is necessary that the
566-
corresponding .lib and .dll files are found at compile and runtime. Prefered way to ensure this:
566+
corresponding .lib and .dll files are found at compile and runtime. Preferred way to ensure this:
567567
</p>
568568
<p>
569569
Copy the <code>*.dll</code> and <code>*.lib</code> for your architecture into your simulation directory (note that working on a 64bit Windows does

Blocks/HardwareIO.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
within Modelica_DeviceDrivers.Blocks;
22
package HardwareIO
3-
"Data aquisition hardware like digital-analog converter, analog-digital converter and other interface hardware."
3+
"Data acquisition hardware like digital-analog converter, analog-digital converter and other interface hardware."
44
extends Modelica.Icons.Package;
55

66
package Comedi

Blocks/Packaging/SerialPackager.mo

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ package SerialPackager "Blocks for constructing packages"
183183
import
184184
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.DummyFunctions;
185185
import Modelica_DeviceDrivers.Packaging.SerialPackager;
186-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
186+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
187187

188188
parameter Boolean useBackwardSampleTimePropagation = true
189189
"true, use backward propagation for sample time (default!), otherwise switch to forward propagation"
@@ -208,8 +208,8 @@ package SerialPackager "Blocks for constructing packages"
208208
when initial() then
209209
/* If userPkgBitSize is set, use it. Otherwise use auto package size. */
210210
backwardPropagatedBufferSize = if pkgOut.userPkgBitSize > 0 then
211-
alignAtByteBoundery(pkgOut.userPkgBitSize) else
212-
alignAtByteBoundery(pkgOut.autoPkgBitSize);
211+
alignAtByteBoundary(pkgOut.userPkgBitSize) else
212+
alignAtByteBoundary(pkgOut.autoPkgBitSize);
213213
bufferSize = if useBackwardPropagatedBufferSize then backwardPropagatedBufferSize
214214
else userBufferSize;
215215
pkgOut.pkg = SerialPackager(bufferSize);
@@ -231,7 +231,7 @@ The <code>Packager</code> block creates a packager object to which payload can b
231231
<h5>Advanced parameter settings</h5>
232232
<p>
233233
With the default parameter settings the buffer size (size of the serialized package), as well as the sample time of the block is determined automatically by
234-
backward propagation. However, that values may also be set manually. An example there this functionality is used is the <a href=\"modelica://Modelica_DeviceDrivers.Blocks.Examples.TestSerialPackager\"><code>TestSerialPackager</code></a> model. In that model the parameter <code>sampleTime</code> is explicitely set, since backward propagation is not possible in that case.
234+
backward propagation. However, that values may also be set manually. An example there this functionality is used is the <a href=\"modelica://Modelica_DeviceDrivers.Blocks.Examples.TestSerialPackager\"><code>TestSerialPackager</code></a> model. In that model the parameter <code>sampleTime</code> is explicitly set, since backward propagation is not possible in that case.
235235
</p>
236236
<h4>Examples</h4>
237237
<p>
@@ -248,7 +248,7 @@ and one Integer value is added, serialized and finally sent using UDP.
248248
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerWriteIcon;
249249
extends
250250
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
251-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
251+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
252252
parameter Integer n = 1;
253253
Modelica.Blocks.Interfaces.BooleanInput u[n]
254254
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
@@ -262,7 +262,7 @@ and one Integer value is added, serialized and finally sent using UDP.
262262
end for;
263263

264264
when initial() then
265-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
265+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
266266
end when;
267267
when (pkgIn.trigger) then
268268
pkgOut.dummy =
@@ -292,14 +292,14 @@ and one Integer value is added, serialized and finally sent using UDP.
292292
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerWriteIcon;
293293
extends
294294
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
295-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
295+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
296296
parameter Integer n = 1;
297297
Modelica.Blocks.Interfaces.IntegerInput u[n]
298298
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
299299
equation
300300

301301
when initial() then
302-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
302+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
303303
end when;
304304
when (pkgIn.trigger) then
305305
pkgOut.dummy =
@@ -332,14 +332,14 @@ and one Integer value is added, serialized and finally sent using UDP.
332332
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerWriteIcon;
333333
extends
334334
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
335-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
335+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
336336
parameter Integer n = 1;
337337
Modelica.Blocks.Interfaces.RealInput u[n]
338338
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
339339
equation
340340

341341
when initial() then
342-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + n*64 else n*64;
342+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + n*64 else n*64;
343343
end when;
344344

345345
when (pkgIn.trigger) then
@@ -372,14 +372,14 @@ and one Integer value is added, serialized and finally sent using UDP.
372372
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerWriteIcon;
373373
extends
374374
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
375-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
375+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
376376
parameter Integer n = 1;
377377
Modelica.Blocks.Interfaces.RealInput u[n]
378378
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
379379
equation
380380

381381
when initial() then
382-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
382+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
383383
end when;
384384

385385
when (pkgIn.trigger) then
@@ -409,14 +409,14 @@ and one Integer value is added, serialized and finally sent using UDP.
409409
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerWriteIcon;
410410
extends
411411
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
412-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
412+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
413413
parameter Integer bufferSize = 40
414414
"Buffer size (in bytes) reserved for String (ensure that same buffer size is used in corresponding GetString block!)";
415415
input String data = "A mostly harmless String" annotation(Dialog=true);
416416
equation
417417
when initial() then
418418
pkgIn.autoPkgBitSize = if nu == 1 then
419-
alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + bufferSize*8 else bufferSize*8;
419+
alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + bufferSize*8 else bufferSize*8;
420420
end when;
421421
when (pkgIn.trigger) then
422422
assert((Modelica.Utilities.Strings.length(data) + 1 <= bufferSize),
@@ -449,7 +449,7 @@ and one Integer value is added, serialized and finally sent using UDP.
449449
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerReadIcon;
450450
extends
451451
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
452-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
452+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
453453
parameter Integer n = 1;
454454
Modelica.Blocks.Interfaces.BooleanOutput y[
455455
n]
@@ -459,7 +459,7 @@ and one Integer value is added, serialized and finally sent using UDP.
459459
Real dummy;
460460
equation
461461
when initial() then
462-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery( pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
462+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary( pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
463463
end when;
464464

465465
when (pkgIn.trigger) then
@@ -495,15 +495,15 @@ and one Integer value is added, serialized and finally sent using UDP.
495495
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerReadIcon;
496496
extends
497497
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
498-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
498+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
499499
parameter Integer n = 1;
500500
Modelica.Blocks.Interfaces.IntegerOutput y[n]
501501
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
502502
protected
503503
Real dummy;
504504
equation
505505
when initial() then
506-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery( pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
506+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary( pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
507507
end when;
508508

509509
when (pkgIn.trigger) then
@@ -535,7 +535,7 @@ and one Integer value is added, serialized and finally sent using UDP.
535535
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerReadIcon;
536536
extends
537537
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
538-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
538+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
539539
parameter Integer n = 1;
540540
Modelica.Blocks.Interfaces.RealOutput y[n]
541541
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
@@ -544,7 +544,7 @@ and one Integer value is added, serialized and finally sent using UDP.
544544
equation
545545

546546
when initial() then
547-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + n*64 else n*64;
547+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + n*64 else n*64;
548548
end when;
549549

550550
when (pkgIn.trigger) then
@@ -579,7 +579,7 @@ and one Integer value is added, serialized and finally sent using UDP.
579579
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerReadIcon;
580580
extends
581581
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
582-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
582+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
583583
parameter Integer n = 1;
584584
Modelica.Blocks.Interfaces.RealOutput y[n]
585585
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
@@ -588,7 +588,7 @@ and one Integer value is added, serialized and finally sent using UDP.
588588
equation
589589

590590
when initial() then
591-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
591+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + n*32 else n*32;
592592
end when;
593593

594594
when (pkgIn.trigger) then
@@ -620,7 +620,7 @@ and one Integer value is added, serialized and finally sent using UDP.
620620
extends Modelica_DeviceDrivers.Utilities.Icons.SerialPackagerReadIcon;
621621
extends
622622
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Internal.PartialSerialPackager;
623-
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundery;
623+
import Modelica_DeviceDrivers.Packaging.alignAtByteBoundary;
624624
import Modelica.Utilities.Strings.length;
625625
parameter Integer bufferSize = 40
626626
"Buffer size (in bytes) reserved for String (ensure that same buffer size is used in corresponding AddString block!)";
@@ -630,7 +630,7 @@ and one Integer value is added, serialized and finally sent using UDP.
630630
equation
631631

632632
when initial() then
633-
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundery(pkgOut[1].autoPkgBitSize)*8 + bufferSize*8 else bufferSize*8;
633+
pkgIn.autoPkgBitSize = if nu == 1 then alignAtByteBoundary(pkgOut[1].autoPkgBitSize)*8 + bufferSize*8 else bufferSize*8;
634634
end when;
635635

636636
when (pkgIn.trigger) then
@@ -663,7 +663,7 @@ and one Integer value is added, serialized and finally sent using UDP.
663663
"Bit offset from current packager position until first encoding bit";
664664
parameter Integer width = 32 "Number of bits that encode the integer value";
665665
Modelica.Blocks.Interfaces.IntegerInput u(min=0)
666-
"Only postive (unsigned) values are supported"
666+
"Only positive (unsigned) values are supported"
667667
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
668668
equation
669669

@@ -696,7 +696,7 @@ and one Integer value is added, serialized and finally sent using UDP.
696696
"Modelica://Modelica_DeviceDrivers/Resources/Images/Icons/Int2BitArrow.png")}),
697697
Documentation(info="<html>
698698
<p>The block allows to pack unsigned integer values on bit level. The number of bits used for encoding is set by parameter <code>width</code>, therefore the maximum value of the integer signal that can be encoded is <code>2^width - 1</code>. The parameter <code>bitOffset</code> allows to specify the bit at which the encoding starts <b>relative</b> to the preceding block. </p>
699-
<p>If an <code>AddBoolean</code>, <code>AddInteger</code>, <code>AddReal</code> or <code>AddString</code> block follows a <code>PackUnsignedInteger</code> block the bit position after the <code>PackUnsignedInteger</code> block is aligned to the next byte boundery.</p>
699+
<p>If an <code>AddBoolean</code>, <code>AddInteger</code>, <code>AddReal</code> or <code>AddString</code> block follows a <code>PackUnsignedInteger</code> block the bit position after the <code>PackUnsignedInteger</code> block is aligned to the next byte boundary.</p>
700700
<h4><font color=\"#008000\">Endianness</font></h4>
701701
<p>Currently, the pack block only supports Intel-Endiannes (<b>little-endian!</b>).</p>
702702
<p>For information about endianness in computing see for example <a href=\"http://en.wikipedia.org/wiki/Endianness\">http://en.wikipedia.org/wiki/Endianness</a></p>
@@ -759,7 +759,7 @@ Value of bit : (0 0 0 0 0 0 1 1) (. . . . . . 0
759759
textString="I")}),
760760
Documentation(info="<html>
761761
<p>The block allows to unpack unsigned integer values on bit level. The number of bits used for decoding is set by parameter <code>width</code>. The parameter <code>bitOffset</code> allows to specify the bit at which the decoding starts <b>relative</b> to the preceding block. </p>
762-
<p>If an <code>GetBoolean</code>, <code>GetInteger</code>, <code>GetReal</code> or <code>GetString</code> block follows an <code>UnpackUnsignedInteger</code> block the bit position after the <code>UnpackUnsignedInteger</code> block is aligned to the next byte boundery.</p>
762+
<p>If an <code>GetBoolean</code>, <code>GetInteger</code>, <code>GetReal</code> or <code>GetString</code> block follows an <code>UnpackUnsignedInteger</code> block the bit position after the <code>UnpackUnsignedInteger</code> block is aligned to the next byte boundary.</p>
763763
<h4><font color=\"#008000\">Endianness</font></h4>
764764
<p>Currently, the pack block only supports Intel-Endiannes (<b>little-endian!</b>).</p>
765765
<p>For information about endianness in computing see for example <a href=\"http://en.wikipedia.org/wiki/Endianness\">http://en.wikipedia.org/wiki/Endianness</a></p>

0 commit comments

Comments
 (0)