Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement LIN using LabVIEW VISA?

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

0 Kudos
Message 1 of 7
(3,292 Views)

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.

0 Kudos
Message 2 of 7
(3,275 Views)

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!

0 Kudos
Message 3 of 7
(3,271 Views)

That is what I would do (scope it and compare it to the desired waveform).

0 Kudos
Message 4 of 7
(3,268 Views)

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

0 Kudos
Message 5 of 7
(3,250 Views)

Did you intend to attach a picture?

0 Kudos
Message 6 of 7
(3,237 Views)

@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.

0 Kudos
Message 7 of 7
(3,209 Views)