functionconstructor

Inputs

TypeNameDefaultDescription
RealbaudrateLink speed (baud) - clamped to [50, 115200] on the C side, a safeguard against a storm of Modelica events
IntegerdataBitsNumber of data bits (5 to 8)
IntegerparityParity, machine.UART convention: -1 = none, 0 = even, 1 = odd
IntegerstopBitsNumber of stop bits (1 or 2)
StringcommandTableCompact table "CMD=>REPLY|CMD=>REPLY"; "|" and "=>" are reserved. {vN} substitutes valueIn[N] in a reply, {oN} captures a number of the command into valueOut[N]
StringterminatorEnd-of-command character; only the first character is kept, so that it can be written "\n" rather than as a numeric code
RealresponseDelayDelay between the recognition of a command and the start of the reply (s)
BooleanrespondEnabledReply to the commands recognised in commandTable (Table mode)
BooleanechoEnabledSend back every received byte unchanged (Table mode)
BooleanperiodicEnabledSpontaneously transmit periodicTemplate every period seconds (Table mode; in Script mode, the presence of on_tick() decides)
RealperiodPeriod of the spontaneous transmission (s)
StringperiodicTemplateTemplate of the periodically transmitted frame ({vN} substituted)
RealvalueOutStartInitial value of valueOut, before any capture
Integermode1 = command table set by parameters, 2 = Python script
StringscriptPathPath of the device's .py script (mode 2 only)
StringpythonHomeEmbedded Python distribution (Resources/PythonRuntime) - used to start CPython if no microcontroller has done it yet
StringinstanceNameComponent name, prefixed to the script's print() output

Outputs

TypeNameDefaultDescription
UartDevicedev