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
Interpretation of lin description file and sending commands via RS232
Interpretation of lin description file and sending commands via RS232
- Attachments
-
- NewProfile.pclin
- (43.49 KiB) Downloaded 3935 times
-
- TSP - FreshWell - LIN Protocol Description V0.30.pdf
- (102.91 KiB) Downloaded 3901 times
Re: Interpretation of lin description file and sending commands via RS232
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
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
Re: Interpretation of lin description file and sending commands via RS232
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: 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
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: 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 3903 times
Re: Interpretation of lin description file and sending commands via RS232
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
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
Re: Interpretation of lin description file and sending commands via RS232
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): 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
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): 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
Re: Interpretation of lin description file and sending commands via RS232
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
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