This command serve to open a communication channel on a LIN bus. There are 5 modes to open channel.

ModeSynopsisDescription
Master 1xLIN OPEN MASTER1X <baud>Open channel at speed <baud> acting as master and using early (“classic”) checksum LIN spec. v1.0
Master 2xLIN OPEN MASTER2X <baud>Open channel at speed <baud> acting as master and using last (“enhanced”) checksum LIN spec. v2.0
Slave 1xLIN OPEN SLAVE1XOpen channel in autobaud acting as slave and using early (“classic”) checksum LIN spec. v1.0
Slave 2xLIN OPEN SLAVE2XOpen channel in autobaud acting as slave and using last (“enhanced”) checksum LIN spec. v2.0
FreeLIN OPEN FREE <baud>Open channel at speed <baud> parity and checksum must to be calculate by user

Return OK

Master mode

On LIN bus only the master can initiate a communication. Master send request and slaves can send replies. Request are composed by sequence of <break><sync><pid> called header where:

  1. break is a 13 bit lengh special value that begin each LIN frame
  2. sync is 0x55 value and serve to slave to make autobaud
  3. pid is the Protected IDentifier (6 bits length identifier prefixed of 2 parity bits calculated accordin to LIN spec.)

Master can send also other bytes other than header playing also the role of slave and replying to itself.

Example:
LIN OPEN MASTER1X 9600
OK
LIN RQ 10     
OK
LIN TX 50       (bus event)
LIN RX F1 CA 43 (bus event)

Where: id=0x10 ⇒ pid=0x50
0xF1 0xCA = data returned by a slave
0x43 = checksum returned by slave

Slave mode

Slave receives master reqest and can send a response. Slave responses are identified by id value and are composed by sequence of 1 to 8 bytes (payload) followed by checksum. If the id of request matches one of slave internal responses records then the reply will be transmitted. Reply will be decorated with checksum according to mode 1x/2x.

Example:
LIN OPEN SLAVE1X
OK
LIN RX 11             (bus event)
LIN TX DE AD BE EF C4 (bus event)

Where: id=0x11 ⇒ pid=0x11
0xDE 0xAD 0xBE 0xEF = data response payload
0xC4 = checksum automatically addded

Free mode

Free mode is intended for logging (sniffing) a bus where master and slaves are other nodes. User can also use free mode to play master or slave role or approaching other non-LIN buses. In free mode baud rate, parity, checksum and id matches are all user responsibility.

Example

Logging a LIN bus at 4800 bps

LIN OPEN FREE 4800
OK
LIN RX 00 55 11 DE AD BE EF C4 
LIN RX 00 55 11 DE AD BE EF C4 
Note
  1. Baud rate range over LIN bus is 1000..20000 bps
  2. To switch mode, closing channel is required, please refer to LIN CLOSE