Unable to change/set data in scheduled frame

This is a forum for the communication between the beta testers and our developers. It is only visible for PEAK-System employees and authorized testers.
Post Reply
sdelling
Posts: 5
Joined: Wed 14. Sep 2022, 11:39

Unable to change/set data in scheduled frame

Post by sdelling » Wed 14. Sep 2022, 11:51

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?

User avatar
S.Grosjean
Software Development
Software Development
Posts: 328
Joined: Wed 4. Jul 2012, 17:02

Re: Unable to change/set data in scheduled frame

Post by S.Grosjean » Thu 15. Sep 2022, 13:03

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,
— Stéphane

sdelling
Posts: 5
Joined: Wed 14. Sep 2022, 11:39

Re: Unable to change/set data in scheduled frame

Post by sdelling » Thu 15. Sep 2022, 15:13

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.

User avatar
S.Grosjean
Software Development
Software Development
Posts: 328
Joined: Wed 4. Jul 2012, 17:02

Re: Unable to change/set data in scheduled frame

Post by S.Grosjean » Fri 16. Sep 2022, 09:27

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,
— Stéphane

Post Reply