blockTextFileSource
A block which creates a stream of SerialPackager packages from a text file.
Extends from Modelica_DeviceDrivers.Utilities.Icons.BaseIcon (Base icon for blocks providing access to external devices), Modelica_DeviceDrivers.Blocks.Communication.Internal.PartialSampleTrigger (Common code for triggering calls to external I/O devices).
Information
A block which creates a stream of SerialPackager packages from reading a text file. It reads one line per activation and writes that line into the SerialPackager package. After end of file is reached an empty string is written to the package.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| String | fileName | "noFile" | File in which data is present |
| Activation | |||
| Boolean | enableExternalTrigger (from PartialSampleTrigger) | false | true, enable external trigger input signal, otherwise use sample time settings below |
| SI.Period | sampleTime (from PartialSampleTrigger) | 0.1 | Sample period of component |
| SI.Time | startTime (from PartialSampleTrigger) | 0 | First sample time instant |
| Incoming data | |||
| Boolean | autoBufferSize | true | true, buffer size is deduced automatically, otherwise set it manually |
| Integer | userBufferSize | 16*1024 | Buffer size of message data in bytes (if not deduced automatically) |
| Advanced | |||
| Boolean | showReceivedBytesPort | false | =true, if number of received bytes port is visible |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.BooleanInput | trigger (from PartialSampleTrigger) | ||
| Modelica_DeviceDrivers.Blocks.Interfaces.PackageOut | pkgOut | ||
| Modelica.Blocks.Interfaces.IntegerOutput | nReceivedBytes | Number of received bytes (including string termination character) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | endOfFile |