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

TypeNameDefaultDescription
StringfileName"noFile"File in which data is present
Activation
BooleanenableExternalTrigger (from PartialSampleTrigger)falsetrue, enable external trigger input signal, otherwise use sample time settings below
SI.PeriodsampleTime (from PartialSampleTrigger)0.1Sample period of component
SI.TimestartTime (from PartialSampleTrigger)0First sample time instant
Incoming data
BooleanautoBufferSizetruetrue, buffer size is deduced automatically, otherwise set it manually
IntegeruserBufferSize16*1024Buffer size of message data in bytes (if not deduced automatically)
Advanced
BooleanshowReceivedBytesPortfalse=true, if number of received bytes port is visible

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.BooleanInputtrigger (from PartialSampleTrigger)
Modelica_DeviceDrivers.Blocks.Interfaces.PackageOutpkgOut
Modelica.Blocks.Interfaces.IntegerOutputnReceivedBytesNumber of received bytes (including string termination character)

Components

TypeNameDefaultDescription
BooleanendOfFile