Page 1 of 1
Receiving LIN data from device
Posted: Tue 22. Feb 2022, 10:13
by plewandowski
Hello Good Sirs,
I've got question regarding receiving status of LIN - device through RS232 communication.
My system looks like this
CarSeat -> PCAN-LIN -> rs232 MOXA ethernet -> PLC
Each time I'm sending any frames to the car-seat, in my receive buffor I get only "02 01 00 01" message - which is, according to Lin protocol definition RS232 return code (Byte 1 - STX, Byte 2 - Seq Code, Byte 3 - Error Code, Byte 4 - Checksum XOR error code)
My question is - what should I do to receive response from LIN device (in my case car seat) - I'd like to check status of frame 0x0B of the device (which consists of 8 data-bytes).
Additional question - in my PCAN-LIN device configuration Filter Mask should be set 0xFF or 0x00?
Re: Receiving LIN data from device
Posted: Tue 22. Feb 2022, 11:14
by M.Maidhof
Hi,
to get a response from a LIN device, you have to send a subscriber frame. Unfortunately you don't write which kind of frame you send (any frame?), so I assume you send a publisher frame, on which a LIN slave will not respond in any way, and you will only get a response from the PCAN-LIN itself, that it has received a valid serial command. To send a subscriber frame you have to OR the LIN ID with 0x80.
regards
Michael
Re: Receiving LIN data from device
Posted: Tue 22. Feb 2022, 11:20
by plewandowski
M.Maidhof wrote: ↑Tue 22. Feb 2022, 11:14
To send a subscriber frame you have to OR the LIN ID with 0x80.
regards
Michael
Yes that was correct, i was sending publisher frame. Could you describe a little bit more what should I do when I'm expecting frame with ID 0x0B?
Re: Receiving LIN data from device
Posted: Tue 22. Feb 2022, 11:43
by M.Maidhof
Hi,
have a look here:
viewtopic.php?f=22&t=6457
see page 9ff for more details how to send subscriber frames by serial, or have a look in the protocol definition pdf which will be installed along with PCAN-LIN CT.
A good solution will be to use PCAN-LIN CT to send those frames for testing, and copy the serial commands from there.
regards
Michael
Re: Receiving LIN data from device
Posted: Tue 22. Feb 2022, 11:54
by plewandowski
Ok, so if I need status of frame 0x0B then i should send 0x02 0x21 0x81 0x8B 0x2B frame configured as subscriber in pcan-lin device?
Re: Receiving LIN data from device
Posted: Tue 22. Feb 2022, 12:38
by M.Maidhof
yes, correct. Please also set the checksum and length code of 0x0B in the frame configuration according to your LIN system.
Re: Receiving LIN data from device
Posted: Tue 22. Feb 2022, 13:02
by plewandowski
Okay, one last question and I think I'll be ready to test it - in PCAN-LIN CT, profiles managment tab
Do I have to set filter mask for 0x00, or default 0xFF should do the work?
Re: Receiving LIN data from device
Posted: Tue 22. Feb 2022, 13:53
by M.Maidhof
keep the filter on default values, so that no filter is used and all messages could be received.
Re: Receiving LIN data from device
Posted: Wed 23. Mar 2022, 11:46
by Marco
Hello everybody,
I would like to control the interface via PLC, as regards the code to be implemented, which command logic did you follow?
is it enough to send publisher frame in hex code, as if you were to control a normal serial device?
And how can i read the slave response?
thanks
Re: Receiving LIN data from device
Posted: Wed 23. Mar 2022, 14:47
by M.Maidhof
Hi,
please have a look on the protocol definition pdf file of PCAN-LIN, or have a look o the following post to see how you could send out publisher and subsciber frames by serial commands:
viewtopic.php?f=22&t=6457
regards
Michael