Interpretation of lin description file and sending commands via RS232

RS-232 to CAN/LIN Interface
Post Reply
Marco
Posts: 4
Joined: Tue 15. Mar 2022, 10:38

Interpretation of lin description file and sending commands via RS232

Post by Marco » Wed 16. Mar 2022, 12:01

Hello,

I'm a beginner in LIN communication.
I have to control an air conditioner via lin bus using the PCAN-LIN interface connected to pc. The parent company has provided me with the protocol description file attached, which I cannot understand. I'm waiting for clarification from the parent company, but maybe someone more experienced than me can help me.

For example, this is only my interpretation (referring to tables pag 4, 5, 6 of the attached file):
For activate the function mode "cool" i need to put high bit 1 corrisponding to "mode A" in "Remote data1" field and bit 0 corresponding to "mode B" in "remote data2" field. So the binary code for "DATA0" field will be 00000010 (0x02) and for "DATA1" 00000001 (0x01).

So data frame will be 0x02, 0x01. Length 2.

For sending to the slave this command the ID= 0x08

So data frame + id frame will be 0x08, 0x02, 0x01. length 3. Could it be right? Or do you see another interpretation?

I've tried to send this frame using "advanced configuration" in PCAN-LIN CT, expecting the conditioner turns in "cool mode" but nothing happen.

The program config is attached.

Thanks
Attachments
NewProfile.pclin
(43.49 KiB) Downloaded 3940 times
TSP - FreshWell - LIN Protocol Description V0.30.pdf
(102.91 KiB) Downloaded 3905 times

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

Re: Interpretation of lin description file and sending commands via RS232

Post by M.Maidhof » Wed 16. Mar 2022, 15:01

Hello,

when looking on the pdf, it looks like you should configure ID 0x08 with 8 data bytes length as publisher (enhanced checksum) and also ID0x17 with 8 data bytes length as subscriber, and setup a scheduler for both IDs with 50ms each. The 3C/3D diagnose will make no sense in a main scheduler setup, this has to be configured when you work in diagnose mode. Try the following config on your system, take care to use the same power supply for both devices (PCAN-LIN and your air conditioner)

regards

Michael
NewProfile2.pclin
(43.79 KiB) Downloaded 3926 times

Marco
Posts: 4
Joined: Tue 15. Mar 2022, 10:38

Re: Interpretation of lin description file and sending commands via RS232

Post by Marco » Wed 16. Mar 2022, 15:58

Hello Michael,
I've upload your configuration on my system and when i send it to the PLIN-CAN interface the air conditioner beeps one time if it's OFF, and beeps one time and switch OFF if it's working, but the "cool mode" doesn't start.
Messages and Scheduler page show this:
Cattura.JPG
Cattura.JPG (41.52 KiB) Viewed 5584 times
What do you think about these errors?
Attached linlog.txt, maybe can help.

About the power supply: Air conditioner is 230VAC device, instead PLIN-CAN interface has its personal DC power supply. It can be a problem?

Thank you for you help.

Regards

Marco
Attachments
LINLog.txt
(15.15 KiB) Downloaded 3904 times

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

Re: Interpretation of lin description file and sending commands via RS232

Post by M.Maidhof » Wed 16. Mar 2022, 16:49

Hi,

please use the same 12V power for PCAN-LIN as it is used with your AC (a LIN system uses Vbat for the termnination, so all LIN nodes must use the same Vbat). Attached a configuration which also uses a 8 byte message for ID 0x08

regards

Michael
NewProfile3.pclin
(44.14 KiB) Downloaded 3942 times

Marco
Posts: 4
Joined: Tue 15. Mar 2022, 10:38

Re: Interpretation of lin description file and sending commands via RS232

Post by Marco » Thu 17. Mar 2022, 15:21

Hi,

Using a 8 byte message also for ID 0x08, now it works. Thank you so much for your help.
Now i'm trying to build all the frame i need for all Function Mode.

QUESTION 1:
Using "Messages and Scheduler" tab is possible to write only one frame at a time for ID 0x08. Is there a function where i can build all my frames and select in real time the one i need?

For example:
For Cool mode with target temperature = 16°C the frame is: id0x08 [82][01][00][00][00][00][00][04]
For Cool mode with target temperature = 17°C the frame is: id0x08 [82][11][00][00][00][00][00][04]

Now for change config i've to go in "profile management" tab, open "frame configuration" , change the frame in id0x08, and send new configuration. There is an easy and fast way?

QUESTION 2:
Using "Advanced Configuration" tab how can i read the slave status (0x17 )? for slave status i mean the information that now i can read in this row (img below):
Cattura.JPG
Cattura.JPG (52.85 KiB) Viewed 5568 times
And consider this data frame: id0x08 [82][01][00][00][00][00][00][04]
Can you please help me to generate the "complete" frame to write in "advanced configuration" tab, for command "write data on bus"?

Thanks for your help

Regards

Marco

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

Re: Interpretation of lin description file and sending commands via RS232

Post by M.Maidhof » Thu 17. Mar 2022, 16:46

Hi Marco,

yes, you can change the LIN publisher data while the Scheduler is active through the Advanced Tab in PCAN-LIN CT, by serial commands from another application, or by CAN. See the pdf from the following post for more details:

viewtopic.php?f=22&t=6457

regards

Michael

Post Reply