:Revision=3
:html
<<
128.116
LIN-Object|LIN
$NoSort
--
The <!RW>LIN IP object gives access to an LIN interface (Local Interconnection Network).

As hardware, a serial interface (COM port, fixed name &quot;LIN&quot;) will be used. 

The command for the LIN bus expect a number to select the addressed LIN bus. As there is only one LIN bus implemented at the moment, this number has always to be 1.

Since Version 1.2.9 Build 968, LIN operation is supported in two different modes:
<H3>IO Mode</H3>
This is the previously existing mode that can still be used without changes.
For communication, the commands Send and Received will be called explicitly and a Keep Alive Frame may be defined to be send in the background.
The frames have to be constructed from the pieces of data with interpreter code. Communication is done on frame basis.
<H3>Task Mode</H3>
This mode is completely new.
Communication is handled completely in the background. A LIN definition will be read from file or will be constructed by command.
The LIN definition contains all information about the nodes on the LIN bus, frames to be exchanged, sender of the frames, timing and even what pieces of data (called signals) are contained in what encoding in every single frame. The interpreter can read or write the value of signals directly. The coding or decoding of signals to frames and vice versa is done by the program. Communication is done on signal basis..
In Task Mode the program can simulate a slave on the LIN bus.

The selection of the LIN Mode is done in the basic setup. It is not possible to switch the mode with a interpreter command. Interpreter commands that don't belong to the selected mode will show no effect.
>>

<<
128.116.1
Functions and procedures in all LIN modes|Common
--
>>
<<
128.116.1.1
LIN.IsActive|IsActive
--
<!DEF>
function <!TW>LIN.IsActive : real;
<!TXT>
Returns <!RW>TRUE, if the LIN bus system is active.

<!DEF>
function <!TW>LIN.IsActive (rNr : real) : real;
<!TXT>
Returns <!RW>TRUE, if the LIN bus <!PW>rNr is active.
>>
<<
128.116.1.2
LIN.IsOpen|IsOpen
--
<!DEF>
function <!TW>LIN.IsOpen (rNr : real) : real;
<!TXT>
Returns <!RW>TRUE, if the LIN bus <!PW>rNr is open.
>>
<<
128.116.1.3
LIN.Error|Error
!128.116.4 - Error codes
--
<!DEF>
function <!TW>LIN.Error (rNr : real) : real;
<!TXT>
Returns the error code for the last action on LIN bus <!PW>rNr.
>>
<<
128.116.1.4
LIN.Open|Open
--
<!DEF>
procedure <!TW>LIN.Open (rNr : real);
<!TXT>
Opens the LIN bus <!PW>rNr.
>>
<<
128.116.1.5
LIN.Close|Close
--
<!DEF>
procedure <!TW>LIN.Close (rNr : real);
<!TXT>
Closes the LIN bus <!PW>rNr.
>>

<<
128.116.4
Error codes of the LIN object|Error codes
--
<!STBL>
<!+>Code<!+>Meaning<!+>
<!c>0<!>no error<!>
<!c>1<!>no serial interface assigned<!>
<!c>2<!>can't open port<!>
<!c>3<!>port is not open<!>
<!c>4<!>timeout<!>
<!c>5<!>checksum error<!>
<!c>6<!>can't read back data sent<!>
<!c>7<!>error in frame<!>
<!c>8<!>command was for other bus mode (Task resp. IO)<!>
<!c>9<!>can't do that when port is open<!>
<!c>10<!>file no found<!>
<!c>11<!>content of file is invalid<!>
<!c>99<!>other error<!>
<!ETBL>
>>

<<
128.116.2
Functions and procedures in IO mode|IO mode
--
Remark: commands in this section will only show an effect, if the LIN bus is in <!SW>IO mode.

In this mode, complete LIN frames will be given to / returned from the interpreter.

The frame has to be constructed/analyzed by the IP-step.

Apartfrom the Keep Alive Frame, that will be send, if the bus is quiet for a given time, no bus access is made in the background.
>>

<<
128.116.2.1
LIN.Received|Received
--
<!DEF>
function <!TW>LIN.Received (rNr, rLength : real) : vector;
<!TXT>
Tries to receive <!PW>rLength data bytes and checksum from the LIN interface.

Only data bytes will be returned. If nothing can be read, [] will be returned.

The status can be checked with <!RW>LIN.Error.
>>
<<
128.116.2.2
LIN.Send|Send
--
<!DEF>
procedure <!TW>LIN.Send (rNr, rID : real; vData : vector);
<!TXT>
Transmits the data in vector <!PW>vData with the Master Task <!PW>rID on LIN bus <!PW>rNr.

The chacksum will be calculated automatically.

Neither Identifier nor data will be chacked for validity.
>>
<<
128.116.2.3
LIN.KeepAlive|KeepAlive
--
<!DEF>
procedure <!TW>LIN.KeepAlive (rNr, rID : real; vFrame : vector [; rInterval : real]);
<!TXT>
Defines the frame, that will be send, if the bus is idle for a specified time.

If in the time, defined by <!PW>rInterval [ms], no communication is made, the frame <!PW>vFrame will be send with Master Task <!PW>rID. If <!PW>rInterval is 0, the cyclic sending is switched off.
>>

<<
128.116.3
Functions and procedures in Task mode|Task mode
--
Remark: commands in this section will only show an effect, if the LIN bus is in <!SW>Task mode.

In this mode, all communication i done in the background, based on a LIN definition.

The LIN definition specifies:
<ul indent=15>
<li>Baudrate and LIN protocol</li>
<li>Nodes on the bus</li>
<li>Signals (data units)</li>
<li>Frames</li>
<li>Scheduling tables</li>
<li>Decoding of signals</li>
</ul>
and of course all the logical links between these items, like where a signal is represented in what frame, which node sends this frame and how the signal will be decoded.

Based on these data, all the communicatzion can be done in the background, thus, the program can simulate a LIN slave.

Interpreter commands can read or set any of these data elements. It's possible to read or set the value of a certain signal (e.g. the brightness of a display) without knowing, where the data is represented on a frame.

Changes on a LIN definition are only possible, if the LIN port is not open.
If the LIN bus is open, changes don't show an effect. Reading and writing of data values (like the content of a signal, or the data of a frame are possible of course).
>>

<<
128.116.3.1
LIN definition|Definition
--
Commands for the <!RW>LIN.Definition affect the whole LIN definition.
>>

<<
128.116.3.1.1
LIN.Definition.Clear|Clear
--
<!DEF>
procedure <!TW>LIN.Definition.Clear (rNr : real);
<!TXT>
Erases the complete LIN definition of LIN bus <!PW>rNr. After this command, no nodes, signals, frames or whatever are defined.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.1.2
LIN.Definition.Load|Load
--
<!DEF>
procedure <!TW>LIN.Definition.Load (rNr : real; sFileName : string);
<!TXT>
Loads the LIN definition for LIN bus <!PW>rNr from the file <!PW>sFileName.

The filename may use a path template.

The file must be a valid definition according to "LIN description file definition" of the  "LIN Configuration Language Specification, Revision 2.0". For some proprietary MCD additions, see <!RW>LIN.Definition.Save

An error message will be shown, if the file is invalid.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.1.3
LIN.Definition.Save|Save
--
<!DEF>
procedure <!TW>LIN.Definition.Save (rNr : real; sFileName : string);
<!TXT>
Saves the LIN definition for LIN bus <!PW>rNr in file <!PW>sFileName.

The filename may use a path template. An existing file will be overwritten.

The file created will be according to "LIN description file definition" of "LIN Configuration Language Specification, Revision 2.0".

Additionally, it will be saved, which nodes will be simulated and which schedule tabel will be active.

The additional parts will be saved in line comments since the LIN specification doesn't define a way for user specific extensions.

Simulated nodes will be stored as:
<!CODE>
//<b>[MCD:SimulatedNodes:</b><i>NodeName</i><b>,</b><i>NodeName</i><b>...]</b>
<!TXT>
If no nodes are simulated, this comment will not be stored.

The active schedule table is stored as:
<!CODE>
//<b>[MCD:ActiveSchedule:</b><i>TableName</i>]</b>
<!TXT>
If no table was acctive, this comment is not stored.

The AutoIncOnSend option of the signale is stored as:
<!CODE>
//<b>[MCD:AutoIncOnSaveSignals:</b><i>SignalName</i><b>,</b><i>SignalName</i><b>...]</b>
<!TXT>
If no signals with this option exist, the comment will not be stored.
>>

<<
128.116.3.1.4
LIN.Definition.Setup|Setup
--
<!DEF>
procedure <!TW>LIN.Definition.Setup (rNr, rBaudRate, rProtocol : real);
<!TXT>
Sets the basic values of the LIN definition for LIN bus <!PW>rNr.

 <!PW>rBaudrate is the communication baudrate for the LIN bus (1000 .. 20000 Bd)

 <!PW>rProtocol selects the LIN protocol

<!STBL>
<!+>rProtocol<!+>LIN Protocol<!>
<!c>0<!>LIN 1.2<!>
<!c>1<!>LIN 1.3<!>
<!c>2<!>LIN 2.0<!>
<!ETBL>
>>

<<
128.116.3.2
LIN Nodes|Node
--
Command of the <!RW>LIN.Node group define nodes on the LIN bus.
The program can simulate one or more of these nodes. One node has to be the master node. Only this node is allowed to start commnuication by sending a master task..
>>

<<
128.116.3.2.1
LIN.Node.Count|Count
--
<!DEF>
function <!TW>LIN.Node.Count (rNr : real) : real;
<!TXT>
Returns the number of defined nodes on LIN bus <!PW>rNr.
>>
<<
128.116.3.2.2
LIN.Node.Exists|Exists
--
<!DEF>
function <!TW>LIN.Node.Exists (rNr : real; sNodeName : string) : real;
<!TXT>
Returns <!RW>TRUE, if on LIN bus <!PW>rNr a node with the name<!PW>sNodeName is defined.
>>

<<
128.116.3.2.3
LIN.Node.Add|Add
--
<!DEF>
procedure <!TW>LIN.Node.Add (rNr: real; sNodeName : string; rIsMaster, rIsSimulated : real);
<!TXT>
Creates an new node wih the name <!PW>sNodeName in the LIN definition of LIN bus <!PW>rNr.

If an node with this name already exists, an error will be triggered.

If <!PW>rIsMaster is <!RW>TRUE, the new node will be the master on the LIN bus. If another node was already master, this other node will be slave.
If <!PW>rIsSimulated is <!RW>TRUE, the program will simulate this node.
For simulated slave nodes, the program will answer master task with slave tasks.
For simulated master nodes, the program will send master tasks according to the active schedule table.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.2.4
LIN.Node.Set|Set
--
<!DEF>
procedure <!TW>LIN.Node.Set (rNr: real; .Node : string|real; rIsMaster, rIsSimulated : real);
<!TXT>
Changes the master/slave state and the simulation state of a node on LIN bus <!PW>rNr.

The node can be addressed with its name (<!PW>Node as <!RW>String) or its index (<!PW>Node as <!RW>Real) in the list of nodes (1 &lt;= <!PW>Node &lt;= nodecount). Specifying a non existing node will trigger an error.

If <!PW>rIsMaster is <!RW>TRUE, the new node will be the master on the LIN bus. If another node was already master, this other node will be slave.
If <!PW>rIsSimulated is <!RW>TRUE, the program will simulate this node.
For simulated slave nodes, the program will answer master task with slave tasks.
For simulated master nodes, the program will send master tasks according to the active schedule table.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.2.4
LIN.Node.Delete|Delete
--
<!DEF>
procedure <!TW>LIN.Node.Delete (rNr: real; .Node : string|real);
<!TXT>
Remove a node from the LIN definition of LIN bus <!PW>rNr.

The node can be addressed with its name (<!PW>Node as <!RW>String) or its index (<!PW>Node as <!RW>Real) in the list of nodes (1 &lt;= <!PW>Node &lt;= nodecount). Specifying a non existing node will trigger an error.

When removing a node, all frames that are send by this node will be removed too.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.2.5
LIN.Node.Get|Get
--
<!DEF>
procedure <!TW>LIN.Node.Get (rNr: real; .Node : string|real; var sNodeName : string; var rIsMaster, rIsSimulated : real);
<!TXT>
Returns the data of a node in the LIN definition of LIN bus <!PW>rNr.

The node can be addressed with its name (<!PW>Node as <!RW>String) or its index (<!PW>Node as <!RW>Real) in the list of nodes (1 &lt;= <!PW>Node &lt;= nodecount). Specifying a non existing node will trigger an error.

 <!PW>sNodeName returns the name of the node (not needed if the node is addresed by its name, but necessary for the command structure)

 <!PW>rIsMaster returns <!RW>TRUE, if the node is the master node

 <!PW>rIsSimulated returns <!RW>TRUE, if the node is simulated by the program
>>

<<
128.116.3.3
LIN Frames|Frame
--
Commands of the <!RW>LIN.Frame group define frames on the LIN bus.

Frames corrlate with master tasks by their ID (0..63).

A frame has between 1 and 8 data bytes.

The LIN definition specifies a unique name for a frame.

Every frame is only send by exactly on node.

A frame may consist of one or more signals.
>>

<<
128.116.3.3.1
LIN.Frame.Count|Count
--
<!DEF>
function <!TW>LIN.Frame.Count (rNr : real) : real;
<!TXT>
Returns the number of frames for LIN bus <!PW>rNr.
>>

<<
128.116.3.3.2
LIN.Frame.Exists|Exists
--
<!DEF>
function <!TW>LIN.Frame.Exists (rNr : real; sFrameName : string) : real;
<!TXT>
Returns <!RW>TRUE, if a frame with the namen <!PW>sFrameName is defined for LIN bus <!PW>rNr 
>>
<<
128.116.3.3.3
LIN.Frame.Data.Get|Data.Get
--
<!DEF>
function <!TW>LIN.Frame.Data.Get (rNr : real; .Frame : real|string) : vector;
<!TXT>
Returns the slave task data of a frame on LIN bus <!PW>rNr.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

If the LIN bus is open, the last received resp. transmitted state of the slave task data will returned.
If the LIN bus if closed, the initialization value wil be returned.
>>

<<
128.116.3.3.4
LIN.Frame.Add|Add
--
<!DEF>
procedure <!TW>LIN.Frame.Add (rNr : real; sName : string; rID : real; .Sender : real|string; rLen : real [; vInitData : vector]);
<!TXT>
Creates a new frame with then name <!PW>sName in the LIN definition of LIN bus <!PW>rNr.

If a frame with this name already exists, an error will be triggered.

The frame is correlated with a master task by the ID <!PW>rID.
If another frame has the same ID, an error will be triggered.

 <!PW>Sender specifies the node sending this frame. The node can be addressed with its name (<!PW>Sender as <!RW>String) or its index (<!PW>Sender as <!RW>Real) in the list of nodes (1 &lt;= <!PW>Sender &lt;= nodecount). Specifying a non existing node will trigger an error.

The numbner of data bytes in the frame is selected by <!PW>rLen (1..8).

If <!PW>vInitData is given, it will be used as initialization data.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.3.5
LIN.Frame.Request|Request
--
<!DEF>
procedure <!TW>LIN.Frame.Request (rNr : real; .Frame : real|string[,Frame2 : real|string]);
<!TXT>
Triggers one or two master tasks for a Frame on the LIN bus <!PW>rNr.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

The master task is even then triggered, if the program does not simulate the master node.

Thsi may yield in invalid situations on the bus. Tis command should only be used, if the program simukates the master node.
>>

<<
128.116.3.3.6
LIN.Frame.Set|Set
--
<!DEF>
procedure <!TW>LIN.Frame.Set (rNr : real; .Frame : real|string; rID : real; .Sender : real|string; rLen : real [; vInitData : vector]);
<!TXT>
Changes the data of a frames in the LIN Definition of LIN bus <!PW>rNr.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

The frame is correlated with a master task by the ID <!PW>rID.
If another frame has the same ID, an error will be triggered.

 <!PW>Sender specifies the node sending this frame. The node can be addressed with its name (<!PW>Sender as <!RW>String) or its index (<!PW>Sender as <!RW>Real) in the list of nodes (1 &lt;= <!PW>Sender &lt;= nodecount). Specifying a non existing node will trigger an error.

The numbner of data bytes in the frame is selected by <!PW>rLen (1..8).

If <!PW>vInitData is given, it will be used as initialization data.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.3.7
LIN.Frame.Delete|Delete
--
<!DEF>
procedure <!TW>LIN.Frame.Delete (rNr : real; .Frame : real|string);
<!TXT>
Removes a frames from the LIN definition of LIN bus <!PW>rNr.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

Signals, correlated with this frame are no longer correlated to any frame after this call.

The frame will be removed from all schedule tables, it is used in.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.3.8
LIN.Frame.Get|Get
--
<!DEF>
procedure <!TW>LIN.Frame.Get (rNr : real; .Frame : real|string; var sName : string; var rID : real; var sSender : string; rLen : real; var .InitData : string|vector]);
<!TXT>
Returns the data of a frame from the LIN definition of LIN bus <!PW>rNr.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

 <!PW>sName returns the name of the frame

 <!PW>rID returns the ID

 <!PW>sSender is the name of the node sending the slave task of this frame
 
 <!PW>rLen returns the number of data bytes in the slave task

 <!PW>InitData returns the value of the initialization data. If <!PW>Initdata is a <!RW>string, the frame will be a byte string (one byte per character), if <!PW>InitData is a <!RW>vector, the frame will be a byte vector (one byte per element) geReturns.
>>

<<
128.116.3.3.9
LIN.Frame.Data.Set|Data.Set
--
<!DEF>
procedure <!TW>LIN.Frame.Data.Set (rNr : real; .Frame : real|string; .Data : string|vector);
<!TXT>
Sets the slave task data of a frame on LIN bus <!PW>rNr.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

The data can be given as byte string (one character per byte) or byte vector (one element per byte).

If the LIN bus is open, the data will be set as the actual slave task data and thus changing the value of the signals correlated with this frame.
If the bus is closed, the intialization values will be changed.

<h4>Optional extensions for task mode over LIN head module</h4>

The following optional parameters have an effect only if LIN communication is enabled in the task mode over the LIN head module and the LIN bus is already opened.

 <!PW>rECS : Extended checksum calculation on/off (True/False)

 <!PW>rCounterFlags : Flags for automatic message counters (bit 0: on/off,)

 <!PW>rCounterOffset : Start position for automatic message counter

 <!PW>rCounterOffset : Length for automatic message counter
>>

<<
128.116.3.3.10
LIN.Frame.Signal.Add|Signal.Add
--
<!DEF>
procedure <!TW>LIN.Frame.Signal.Add (rNr : real; .Frame : real|string; .Signal : real|string; rOffset : real);
<!TXT>
Correlates a signal with a frame on LIN bus <!PW>rNr.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

 <!PW>rOffset is the bit offset of the signal in the frame (0..63)

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.4
LIN Schedule Tables|Schedule
--
Commands of the <!RW>LIN.Schedule group define LIN schedule tables.

A schedule table defines the cycle of master task sent by the master node.

Any number of schedule tabkles can be defined, but only one schedule table might be active at any given moment.
>>

<<
128.116.3.4.1
LIN.Schedule.Count|Count
--
<!DEF>
function <!TW>LIN.Schedule.Count (rNr : real) : real;
<!TXT>
Returns the number of schedule tables on LIN bus <!PW>rNr.
>>

<<
128.116.3.4.2
LIN.Schedule.Exists|Exists
--
<!DEF>
function <!TW>LIN.Schedule.Exists (rNr : real; sScheduleName : string) : real;
<!TXT>
Returns <!RW>TRUE, if a schedule table with the name <!PW>sScheduleName is defined on LIN bus <!PW>rNr.
>>

<<
128.116.3.4.3
LIN.Schedule.Active|Active
--
<!DEF>
function <!TW>LIN.Schedule.Active (rNr : real; .Schedule : real|string) : real;
<!TXT>
Returns <!RW>TRUE, if the schedule table is active on LIN bus <!PW>rNr.

The schedule table can be addressed with its name (<!PW>Schedule as <!RW>String) or its index (<!PW>Schedule as <!RW>Real) in the list of schedule tables (1 &lt;= <!PW>Schedule &lt;= scheduletablecount). Specifying a non existing schedule tablewill trigger an error.
>>

<<
128.116.3.4.4
LIN.Schedule.Frame.Count|Frame.Count
--
<!DEF>
function <!TW>LIN.Schedule.Frame.Count (rNr : real; .Schedule : real|string) : real;
<!TXT>
Returns the number of frames contained in the schedule table on LIN bus <!PW>rNr.

The schedule table can be addressed with its name (<!PW>Schedule as <!RW>String) or its index (<!PW>Schedule as <!RW>Real) in the list of schedule tables (1 &lt;= <!PW>Schedule &lt;= scheduletablecount). Specifying a non existing schedule tablewill trigger an error.
>>

<<
128.116.3.4.5
LIN.Schedule.Add|Add
--
<!DEF>
procedure <!TW>LIN.Schedule.Add (rNr : real; sName : string);
<!TXT>
Creates a new schedule table with the name <!PW>sName in the LIN definition of LIN bus <!PW>rNr.

If another schedule table with this name exists, an error will be triggered.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.4.6
LIN.Schedule.Delete|Delete
--
<!DEF>
procedure <!TW>LIN.Schedule.Delete (rNr : real; .Schedule : real|string);
<!TXT>
Removes a schedule table from the LIN definition of LIN bus <!PW>rNr.

The schedule table can be addressed with its name (<!PW>Schedule as <!RW>String) or its index (<!PW>Schedule as <!RW>Real) in the list of schedule tables (1 &lt;= <!PW>Schedule &lt;= scheduletablecount). Specifying a non existing schedule tablewill trigger an error.

If the LIN bus is open, this command will show no effect.
>>

<<
128.116.3.4.7
LIN.Schedule.Get|Get
--
<!DEF>
procedure <!TW>LIN.Schedule.Get (rNr : real; .Schedule : real|string; var sName : string) ;
<!TXT>
Returns the data of a schedule table on LIN bus <!PW>rNr.

The schedule table can be addressed with its name (<!PW>Schedule as <!RW>String) or its index (<!PW>Schedule as <!RW>Real) in the list of schedule tables (1 &lt;= <!PW>Schedule &lt;= scheduletablecount). Specifying a non existing schedule tablewill trigger an error.

 <!PW>sName returns the name of the scedule table.
>>

<<
128.116.3.4.8
LIN.Schedule.Frame.Add|Frame.Add
--
<!DEF>
procedure <!TW>LIN.Schedule.Frame.Add (rNr : real; .Schedule : real|string; .Frame : real|string; rDelay : real);
<!TXT>
Adds a frame to a schedule table on the LIN bus <!PW>rNr.

The schedule table can be addressed with its name (<!PW>Schedule as <!RW>String) or its index (<!PW>Schedule as <!RW>Real) in the list of schedule tables (1 &lt;= <!PW>Schedule &lt;= scheduletablecount). Specifying a non existing schedule tablewill trigger an error.

The frame can be addressed with its name (<!PW>Frame as <!RW>String) or its index (<!PW>Frame as <!RW>Real) in the list of frames (1 &lt;= <!PW>Frame &lt;= framecount). Specifying a non existing frame will trigger an error.

 <!PW>rDelay defines the time [1..120000 ms] from sending this frames to the sending of the next frame.
>>

<<
128.116.3.4.9
LIN.Schedule.Frame.Delete|Frame.Delete
--
<!DEF>
procedure <!TW>LIN.Schedule.Frame.Delete (rNr : real; .Schedule : real|string; rIndex : real);
<!TXT>
Removes an entry of a schedule table of LIN bus <!PW>rNr.

The schedule table can be addressed with its name (<!PW>Schedule as <!RW>String) or its index (<!PW>Schedule as <!RW>Real) in the list of schedule tables (1 &lt;= <!PW>Schedule &lt;= scheduletablecount). Specifying a non existing schedule tablewill trigger an error.

The frame must be addressed with its index in the schedule table (not the list of frames!). Specifying a non existing index will trigger an error.
>>

<<
128.116.3.4.10
LIN.Schedule.Frame.Get|Frame.Get
--
<!DEF>
procedure <!TW>LIN.Schedule.Frame.Get (rNr : real; .Schedule : real|string; rIndex : real; var sFrame : string; var rDelay : real);
<!TXT>
Returns the data of an entry of a schedule tableof LIN bus <!PW>rNr.

The schedule table can be addressed with its name (<!PW>Schedule as <!RW>String) or its index (<!PW>Schedule as <!RW>Real) in the list of schedule tables (1 &lt;= <!PW>Schedule &lt;= scheduletablecount). Specifying a non existing schedule tablewill trigger an error.

The frame must be addressed with its index in the schedule table (not the list of frames!). Specifying a non existing index will trigger an error.

 <!PW>sFrame returns the name of the frame,  <!PW>rDelay returns the delay in [ms]
>>
<<
128.116.3.5
LIN Signals|Signal
--
Commands of the <!RW>LIN.Signal group define LIN Signals.

A signal is a information entity, has a unique name and can be correlated to a range of bits in a frame and a encoding rule.
Accessing the value of a signal actually accesses the bit range of a frame, but without have to define any bit maks and shift operations. All this is done by the program.
A signal can be a scalar value (an integer value) or an array (field of bytes).
>>

<<
128.116.3.5.1
LIN.Signal.Count|Count
--
<!DEF>
function <!TW>LIN.Signal.Count (rNr : real) : real;
<!TXT>
Returns the number of signals defined on LIN bus <!PW>rNr.
>>

<<
128.116.3.5.2
LIN.Signal.Exists|Exists
--
<!DEF>
function <!TW>LIN.Signal.Exists (rNr : real; sSignalName : string) : real;
<!TXT>
Returns <!RW>TRUE, if a signal with the name <!PW>sSignalName is defined for LIN bus <!PW>rNr.
>>

<<
128.116.3.5.3
LIN.Signal.GetTypeCode|GetTypeCode
--
<!DEF>
function <!TW>LIN.Signal.GetTypeCode (rNr : real; .Signal : real|string) : real;
<!TXT>
Returns the type of the data (scalar or array) of a signals on LIN bus <!PW>rNr.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

Return value:
<!STBL>
<!>1<!>Scalar<!>
<!>3<!>Array<!>
<!ETBL>
>>

<<
128.116.3.5.4
LIN.Signal.Data.Get|Data.Get
--
<!DEF>
function <!TW>LIN.Signal.Data.Get (rNr : real; .Signal : real|string; rNice : real) : real|string|vector;
<!TXT>
Returns tha value of a signal on LIN bus <!PW>rNr.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

The data type returned by this function depends on the parameter <!PW>rNice and the data type of the signal.

If <!PW>rNice is <!RW>FALSE,the function will return a real or a vector depending on the data type of the signal.
If <!PW>rNice is <!RW>TRUE, the function will allways return a string. This string will contain the value itself and - if a decoding ruke is present - decoded value of the signal.

Return value:
<!STBL>
<!+>rNice<!+>Data type of signals<!+>Return type<!+>Example<!>
<tr><td rowspan=2 align=center><!RW>FALSE<!c><!RW>Scalar<!c><!RW>real<!>1<!>
                                         <!c><!RW>Array <!c><!RW>vector<!>[50, 52, 54, 56, 65]<br><font size=-2>Byte vector</font><!>
<tr><td rowspan=2 align=center><!RW>TRUE <!c><!RW>Scalar<!c><!RW>string<!>'1 - Night illumination on'<!>
                                         <!c><!RW>Array <!c><!RW>string<!>'[32 34 36 38 41] = '2468A''<br><font size=-2>Byte vector, hexadecimal coded and decoded, here as ASCII text</font><!>
<!ETBL>
>>

<<
128.116.3.5.5
LIN.Signal.Add|Add
--
<!DEF>
procedure <!TW>LIN.Signal.Add (rNr : real; sSignalName : string; rAsArray, rLength : real; vInitData : vector; .Sender : real|string);
<!TXT>
Creates an new Signal in the LIN definition of LIN bus <!PW>rNr.

 <!PW>sSignalName defines the name of the new signal.
If another signal with this name exists, an error will be triggered.

If <!PW>rAsArray is <!RW>TRUE, the signal holds an array, otherwise a scalar value.

 <!PW>rLength is the length of the signal in bits. Allowed is a value of 1..16 for scalar values and multiples of 8 up to 64 for arrays.

 <!PW>vInitData is the initialization value of the signal. 
For scalar signals a vector with one element must be given. This element must be in the range of  0 ..  2<sup><!PW>rLength</sup>-1. 
For array signals a byte vector with <!PW>rLength / 8 elements must be given.

 <!PW>Sender is the node transmitting this signal. The node can be addressed with its name (<!PW>Sender as <!RW>String) or its index (<!PW>Sender as <!RW>Real) in the list of nodes (1 &lt;= <!PW>Sender &lt;= nodecount). Specifying a non existing node will trigger an error.
>>
<<
128.116.3.5.6
LIN.Signal.Delete|Delete
--
<!DEF>
procedure <!TW>LIN.Signal.Delete (rNr : real; .Signal : real|string);
<!TXT>
Remove a signal from the LIN definition of LIN bus <!PW>rNr.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.
>>
<<
128.116.3.5.7
LIN.Signal.Get|Get
--
<!DEF>
procedure <!TW>LIN.Signal.Get (rNr : real; .Signal : real|string; var sName : string; var rIsArray, rLength : real; var vInitData : vector; var sSenderName : string);
<!TXT>
Returns the data of a signal from the LIN definition of LIN bus <!PW>rNr.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

 <!PW>sName returns the name of the signal

 <!PW>rIsArray returns<!RW>TRUE, if the signal is a array valuedarstellt.

 <!PW>rLength returns the length of the signal in bits

 <!PW>vInitData returns the initialization value of the signal

 <!PW>sSenderName returns the name of the node transmitting this signal
>>

<<
128.116.3.5.8
LIN.Signal.Request|Request
--
<!DEF>
procedure <!TW>LIN.Signal.Request (rNr : real; .Signal : real|string);
<!TXT>
Triggers a master task on LIN bus <!PW>rNr to request a signal.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

The master task is even then triggered, if the program does not simulate the master node.

Thsi may yield in invalid situations on the bus. Tis command should only be used, if the program simukates the master node.
>>

<<
128.116.3.5.9
LIN.Signal.Data.Set|Data.Set
--
<!DEF>
procedure <!TW>LIN.Signal.Data.Set (rNr : real; .Signal : real|string; vData : vector);
<!TXT>
Sets the value of a signals on LIN bus <!PW>rNr.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

 <!PW>vData is the new value of the signal. 
For scalar signals a vector with one element must be given. This element must be in the range of  0 ..  2<sup>length of signal</sup>-1. 
For array signals a byte vector with <b>length of signal / 8</b> elements must be given.

If the bus is open, the actual value of the signal is changed, if the bus is closed, the initialization value is changed.
>>

<<
128.116.3.5.10
LIN.Signal.Valid|Valid
--
<!DEF>
function <!TW>LIN.Signal.Valid (rNr : real; .Signal : real|string) : real;
<!TXT>
Returns <!RW>TRUE, if the signal is valid.
A signal is valid, if the last master task, requesting the frame with this signal was answered correctly.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.
>>

<<
128.116.3.5.11
LIN.Signal.Option.Set|Option.Set
--
<!DEF>
procedure <!TW>LIN.Signal.Option.Set (rNr : real; .Signal : real|string; rOptionNr, rOptionValue : real);
<!TXT>
Sets an option of a signal on the LIN bus <!PW>rNr.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

 <!PW>rOptionNr selects the option
 <!PW>rOptionValue is the new value of the option

<!STBL>
<!+>OptionNr<!+>Desctription of the option<!+>Values for OptionVal<!>
<!c>1<!><b>AutoIncOnSend</b><br>The signal will be automatically incremented when transmitted<!><!RW>TRUE : option active<br><!RW>FALSE : option inactive (default)<!>
<!ETBL>
>>

<<
128.116.3.5.12
LIN.Signal.Option.Get|Option.Get
--
<!DEF>
procedure <!TW>LIN.Signal.Option.Set (rNr : real; .Signal : real|string; rOptionNr, rOptionValue : real);
<!TXT>
Returns the state of an option of a signals on LIN bus <!PW>rNr.

The signal can be addressed with its name (<!PW>Signal as <!RW>String) or its index (<!PW>Signal as <!RW>Real) in the list of signals (1 &lt;= <!PW>Signal &lt;= signalcount). Specifying a non existing signal will trigger an error.

 <!PW>rOptionNr selects the option

<!STBL>
<!+>OptionNr<!+>Desctription of the option<!+>Values for OptionVal<!>
<!c>1<!><b>AutoIncOnSend</b><br>The signal will be automatically incremented when transmitted<!><!RW>TRUE : option active<br><!RW>FALSE : option inactive (default)<!>
<!ETBL>
>>
