Page 1 of 1

Unable to change/set data in scheduled frame

Posted: Wed 14. Sep 2022, 11:51
by sdelling
Hello,

I want to periodically send a frame so I schedule it but on the receiving side I only get empty frames.

This is what I do:

Code: Select all

lin start master 19200 /dev/plin0
lin set pub-frm-entry 0x1E -d "0x0 0x0 0xF8 0xF8 0xFF 0xFF 0xFF 0xFF" -l 8 -e /dev/plin0
lin add unc-schd-slot 0 100 0x1E /dev/plin0
lin start schedule 0 /dev/plin0
lin set frm-entry-data 0x1E --data "0x1A 0xBB 0x66 0xB2 0xFF 0xDD 0xFA 0xF3" /dev/plin0
Sending it via

Code: Select all

linwrite -i=0x1E -b="0x0 0x0 0xF8 0xF8 0xFF 0xFF 0xFF 0xFF" -d=P /dev/plin0
produces the desired result.

What am I doing wrong?

Re: Unable to change/set data in scheduled frame

Posted: Thu 15. Sep 2022, 13:03
by S.Grosjean
Hi,

Thank you for your interest in the PEAK-System LIN products under Linux.

First, your publisher frame lacks of enabling response from slave (missing -r):

Code: Select all

lin set pub-frm-entry 0x1E -d "0x0 0x0 0xF8 0xF8 0xFF 0xFF 0xFF 0xFF" -l 8 -e -r /dev/plin0
Then, be sure that the slave side has no receive filter that would prevent it to read the frame.

With plin, one explicitly sets the ID filter to "receive all" and reads the bus from LIN device $dev like this:

Code: Select all

lin set id-filter 0xff:0xff:0xff:0xff:0xff:0xff:0xff:0xff $dev
linread $dev
Regards,

Re: Unable to change/set data in scheduled frame

Posted: Thu 15. Sep 2022, 15:13
by sdelling
Hi,

thanks for the reply. It seems the -r does the trick!

But I do not understand what response from slave has to do with receiving the correct data.
I use a different make of LIN adapter for reception so the filter was no problem.

Re: Unable to change/set data in scheduled frame

Posted: Fri 16. Sep 2022, 09:27
by S.Grosjean
Hi,

Publishing DATA from the master node leads the node to act as a "slave": to transmit DATA bits, the master must first update its internal slave task response with the DATA values it wishes to transmit. The master then publishes the appropriate frame header and the internal slave task transmits its DATA load to the bus. That's the aim of the "-r" switch.

Best regards,