05-20-2019 10:36 AM
Hello,
I am working on implementing LIN 2.1 protocol on existing RS232 hardware using LabVIEW VISA. Does anyone have experience with this?
I am just implementing unconditional frames, so it should be pretty straightforward once I have the timings right. But that is the part where I am getting stuck. The protocol uses a 13-bit break with a delimeter to signal start of frame header. I am currently using VISA Serial Break.vi with a break time of 1ms to achieve this. One doubt I have is that my application runs at 19.2k baud, therefore a 13-bit break only translates to roughly 2/3 of a millisecond. The closest timing I can get is the 1ms floor of the VISA Serial Break.vi
Then I am sending 0x55 through a VISA write and then writing the ID of the frame. The program gives me an I/O error everytime I try to run this.
How can I fix this? does someone here have experience implementing LIN using VISA?
Any help would be much appreciated!!
Thanks very much
05-20-2019 02:39 PM
You could lower the baud rate for one byte to make the bus keep the byte for a longer amount of time. You need approximately a 50% longer byte time, so something like 14.4k would get you close.
05-20-2019 02:54 PM
That sounds like it could work! I will try and report back.
How would you approach this from a troubleshooting/debugging perspective? Take a scope and monitor the bus?
Thanks very much!
05-20-2019 02:57 PM
That is what I would do (scope it and compare it to the desired waveform).
05-21-2019 11:30 AM
Hi, so I tried the suggestions and am running into some difficulties. I tried to scope out the bus and I cannot make much sense of it. Just some context, it is LIN over the PLC line. The B+ for our DUT is at 24V and I see some ripple on the line, but I cannot discern individual bytes/bits. How do you interpret the waveform?
Thanks for your help thus far
05-22-2019 07:26 AM
Did you intend to attach a picture?
05-28-2019 08:52 AM
@js7041 wrote:
I am working on implementing LIN 2.1 protocol on existing RS232 hardware using LabVIEW VISA. Does anyone have experience with this?
What are you talking about? This is like saying "I have a headphone jack coming out of my laptop and I want to talk ethernet with it". You are using hardware for what it wasn't designed for (unless I'm mistaken). If you want to use LIN, get LIN hardware. You can't talk LIN over RS232, they are two different things that may use the same DB-9 physical port. And VISA is a software layer on top of hardware to allow for communicating with standard APIs and has nothing to do with LIN. If you want to talk LIN, get some LIN hardware. NI has some, Intrepid and Vector also have some with some level of LabVIEW drivers.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord