HowTo PCAN-LIN V1.0.0.2
HowTo PCAN-LIN V1.0.0.2
The PCAN-LIN module is a flexible LIN/CAN/Serial Gateway, which can be used in different
applications. In this “how to” document we will show you different ways to use the PCAN-LIN module
for LIN applications in master or slave mode.
PCAN-LIN Configuration:
The PCAN-LIN can only be configured using a serial connection. Best solution is to use a native COM
port of your PC/Mainboard. If you use an USB2Serial device, please note, that only a module with a
FTDI chip will work correctly with the PCAN-LIN CT application.
The “Data Present in Module” Tab will show the current configuration on the module. To configure
the PCAN-LIN, click on the “create a new profile with standard settings” button. Now you can setup
the bitrates, forward masks and all other needed settings. See below for the details on different
scenarios. Save this profile on your hard disk and send it to the module using the “Send” button.
To use the PCAN-LIN as a LIN monitoring tool (listener only) you have to set the bitrate for
LIN and CAN and the LIN forward mask to CAN or LIN (or both) to see the LIN messages on
those connections (also enable the error forwarding to be able to see problems due to a
wrong frame configuration setup). Next, you have to set the frame configuration to the
needed settings given by your LIN specification or ldf file. When you use a LIN 2.0 system you
have to set all frames to Checksum Type “Enhanced” and set the length code as given by
your LIN description or ldf file. Here an example for a ldf file, and how to extract the required
information from it:
Note: a *.ldf file is an ASCII based configuration file which can be displayed with a text editor:
Here the used LIN protocol Version is 2.x, so you have to setup all used LIN frames to
“enhanced” Checksum type.
Note: the LIN frames 0x3C and 0x3D (master request, slave response) always uses classic
Checksum type, even in a LIN 2.x system!
In the frame section of the ldf file, you will see the used frames and length codes:
Keep direction as “Subscriber” for all frames, in case you only want to “listen” to the LIN bus
system. In the LIN section, set Master Status to “Inactive” and LIN Bus Termination to
“Slave”:
You could use the trace option in PCAN-LIN CT or PCAN-View to log the received data to disk.
Next, you have to modify the frame configuration to the required Checksum type and length
code, and configure the publisher frames (here ID 5) with default data:
Note: when setting the cursor over the P00 to P03 parameters, there will be a hint displayed
in the status bar, showing you which parameter must be set in that specific field.
The used serial command will be displayed below as raw-command: 0x02 0x24 0xA9 0x01
0x05 0xAB 0xCD 0x EF
Result:
To change the publisher data by CAN while a scheduler is active, an ID offset 0f 0x40 must be
used: CAN-ID = 5 + 0x40 + CAN-ID Offset =0x45 (CAN ID Offset is set to 0 in that config)
The length code must match to the length code of the publisher data.
Sending a Subscriber frame with PCAN-LIN CT (ID: 0x05 or 0x80 (subscriber option) = 0x85):
Blue markings are the positive response from PCAN-LIN, red markings show the data from
the LIN slave responding on 0x01 subscriber frame
In the receive Window the answer from the LIN slave (data) on that subscriber frame will be
visible.
As you can see with these examples, PCAN-LIN is a very flexible device to handle
LIN/CAN/Serial tasks. If you have questions regarding the use of PCAN-LIN, you can contact
our support team by email or post your request in our forum.