Receiving data from lin device using RS232

RS-232 to CAN/LIN Interface
rollinstone
Posts: 10
Joined: Wed 13. Jan 2016, 13:58

Receiving data from lin device using RS232

Post by rollinstone » Wed 18. Nov 2020, 11:26

Hello,
i'm using pcan-lin gateway to communicate with carseat. Frames are sent from PLC through rs interface to PCAN-Lin device.

All the commands that i'm sending to start executive elements are working, but i'm not able to receive response frame from the device.

i'm sending 02 09 81 31 53 00 03 80 00 00 00 00 69
where
02 - stx
09 - frame length + 1
81 - CC
31 - frame id
53 00 03 80 00 00 00 00 - frame
69 - checksum

Expected response should be frame consisting of 2 bytes, with id 0B
instead - all i receive is frame "02 01 00 01" which according to PEAK docummentation means "Positive Response"

Lin config in attachment
Attachments
ln.png
ln.png (9.55 KiB) Viewed 465 times

M.Maidhof
Support
Support
Posts: 1303
Joined: Wed 22. Sep 2010, 14:00

Re: Receiving data from lin device using RS232

Post by M.Maidhof » Wed 18. Nov 2020, 15:21

Hi,

as a LIN master, you must also send the subscriber frame, so that your LIN slave could answer to it. Check that the frame config for ID 0x0B is set to subscriber, and send a subsciber frame for 0x0B through the following command: 0x02 0x21 0x81 0x8B 0x2B

regards

Michael

rollinstone
Posts: 10
Joined: Wed 13. Jan 2016, 13:58

Re: Receiving data from lin device using RS232

Post by rollinstone » Thu 19. Nov 2020, 07:00

M.Maidhof wrote:
Wed 18. Nov 2020, 15:21
Hi,

as a LIN master, you must also send the subscriber frame, so that your LIN slave could answer to it. Check that the frame config for ID 0x0B is set to subscriber, and send a subsciber frame for 0x0B through the following command: 0x02 0x21 0x81 0x8B 0x2B

regards

Michael
Hi Michael, thank you for fast feedback.
Just to make it clear - i'm suppose to send 02 21 81 8B 2B frame instead of 02 09 81 31 53 00 03 80 00 00 00 00 69? Or should i send them alternately?

M.Maidhof
Support
Support
Posts: 1303
Joined: Wed 22. Sep 2010, 14:00

Re: Receiving data from lin device using RS232

Post by M.Maidhof » Thu 19. Nov 2020, 08:16

Hi,

as a LIN Master you must send publisher and subscriber frames. So you must send both, if you like to get data from your connected LIN slave. Take care that you have set the correct checksum type and length code in the frame config, which fits to your LIN slave. Details can be found in the ldf file of your LIN node.

regards

Michael

rollinstone
Posts: 10
Joined: Wed 13. Jan 2016, 13:58

Re: Receiving data from lin device using RS232

Post by rollinstone » Thu 19. Nov 2020, 09:29

M.Maidhof wrote:
Thu 19. Nov 2020, 08:16
Hi,

as a LIN Master you must send publisher and subscriber frames. So you must send both, if you like to get data from your connected LIN slave. Take care that you have set the correct checksum type and length code in the frame config, which fits to your LIN slave. Details can be found in the ldf file of your LIN node.

regards

Michael
Thank You. So i suppose if i'm sending frames form PLC through rs232 interface - i have to switch between these two frames? one cycle i send 02 09 81 31 53 00 03 80 00 00 00 00 69 and next cycle 02 21 81 8B 2B ?

M.Maidhof
Support
Support
Posts: 1303
Joined: Wed 22. Sep 2010, 14:00

Re: Receiving data from lin device using RS232

Post by M.Maidhof » Thu 19. Nov 2020, 11:11

yes, and keep the timing as it is specified in the scheduler definition of your ldf.

regards

Michael

rollinstone
Posts: 10
Joined: Wed 13. Jan 2016, 13:58

Re: Receiving data from lin device using RS232

Post by rollinstone » Fri 27. Nov 2020, 08:09

M.Maidhof wrote:
Thu 19. Nov 2020, 11:11
yes, and keep the timing as it is specified in the scheduler definition of your ldf.

regards

Michael
Hello,

i tried to send both my frame with id 31 with subscriber frame, but i did not get confirmation of pushing any button at the carseat
when i was sending frame 31 - i've received answer which i've mentioned before so it was 02 01 00 01, when subscriber frame was sent - i've received "02 21 00 21" - no matter what i've pressed at the carseat

M.Maidhof
Support
Support
Posts: 1303
Joined: Wed 22. Sep 2010, 14:00

Re: Receiving data from lin device using RS232

Post by M.Maidhof » Fri 27. Nov 2020, 13:07

Hi,

with the given info, we can't help you. Please provide the ldf of your system and the configuration of your PCAN-LIN module, to see if the configurations fits to your LIN device.

regards

Michael

rollinstone
Posts: 10
Joined: Wed 13. Jan 2016, 13:58

Re: Receiving data from lin device using RS232

Post by rollinstone » Fri 27. Nov 2020, 13:13

M.Maidhof wrote:
Fri 27. Nov 2020, 13:07
Hi,

with the given info, we can't help you. Please provide the ldf of your system and the configuration of your PCAN-LIN module, to see if the configurations fits to your LIN device.

regards

Michael
How do i get ldf file from the device?
Please find config of pcan-lin module in attachment
Attachments
cfg.pclin
(43.47 KiB) Downloaded 17 times

M.Heidemann
Sales & Support
Sales & Support
Posts: 424
Joined: Fri 20. Sep 2019, 13:31

Re: Receiving data from lin device using RS232

Post by M.Heidemann » Fri 27. Nov 2020, 14:59

Hello,

Thank your for providing the configuration file.

The LIN Description File (LDF) is an text file supplied by manufacturer and contains information about publishers and subscribers, signals and frames, in short a description of the LIN-network.

This file may be obtained from the manufacturer of the LIN-node (car seat).

For further questions feel free to contact me again.

Best Regards

Marvin

Post Reply