LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Third Party LIN to USB Converter using serial Communication

Hi all. Sorry if my question seems to be uneducated. I'm just new to Labview Environment. I have third party LIN to USB converter for my project. In Labview, this converter only recognized as "com" which in my case "com3". Using Labview, I only can use Visa serial to communicate with the device. When I sent command the break signal then followed sync field = 0x55 and the PID = 0xA8 the respond returns back to be 0055A8. Unit should respond with "XX XX XX YY XX 0X FF FF" as example. If anybody can help me get trough this, I will be greatly thankful.

 

I attached picture as the reference. LIN Serial project .jpg

 

0 Kudos
Message 1 of 10
(1,588 Views)

Hi man,

 


@man001 wrote:

When I sent command the break signal then followed sync field = 0x55 and the PID = 0xA8 the respond returns back to be 0055A8. Unit should respond with "XX XX XX YY XX 0X FF FF" as example. If anybody can help me get trough this, I will be greatly thankful.


Why do you send a break?

Which kind of LIN-USB converter do you use?

Can you link to a manual of that device?

Why do you send a value of "28" when you want to send 0xA8?

Did you set that integer constant to use hex display? (We cannot edit/debug/run images in LabVIEW!!!)

Why do you (try to) read 16 bytes when you expect a response of 8 bytes? (Or does that response string consist of 25 chars/bytes?)

Why do you enable the (default) TermChar for your serial communication?

Why don't you use AutoCleanup?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(1,584 Views)

I sent it because LIN protocol need to have break signal then followed by sync field = 0x55 and the PID 0xA8 right? Because the computer is the master, so it need to sent the header which consist of break signal, sync field and PID. 

 

I use third party converter which I don't have the manuals. I can share with you the link of the products which is exactly same from what I got. Here the product's link = https://www.tindie.com/products/0x1B/lin-usb-adapter/

 

I tried to use XNET but Labview doesn't recognize this as XNET driver. 

0 Kudos
Message 3 of 10
(1,576 Views)

Sorry, here is my reply. 

 

Why do you send a break?

This is because I followed the LIN protocol that master need to send the break signal.

 

Which kind of LIN-USB converter do you use?

It is third party converter. 

LIN to USB converter.jpg

Can you link to a manual of that device?

I don't have the manuals for this product. I'm still trying to get the manuals of this products.

 

Why do you send a value of "28" when you want to send 0xA8?

This is because I read a few documents about the PID. If the PID needed is 0xA8, I need to send in hex 0x28.

 

Did you set that integer constant to use hex display? (We cannot edit/debug/run images in LabVIEW!!!)

Yes, I set it to hex display

 

Why do you (try to) read 16 bytes when you expect a response of 8 bytes? (Or does that response string consist of 25 chars/bytes?)

I'm sorry, my mistake. the respond should be like this "XX XX XX YY XX 0X FF FF".

 

Why do you enable the (default) TermChar for your serial communication?

I'm sorry, I do something try and error. This isdue to my limited knowledge on Labview.

 

Why don't you use AutoCleanup?

I'm sorry, I have no knowledge about this.

 

Can you help me regarding this matter?

Regards

 

 

 

0 Kudos
Message 4 of 10
(1,570 Views)

if that adapter is anything worth it is not expecting you to shoehorn the requirements of the LIN Bus verbatim onto the serial side! If it does you may consider to buy a real device instead.

 

Serial break is in fact a number of 0 bits at least 1 bit interval more than the number of data bits plus the start bit. As such it is an illegal character and you can NOT emulate it by sending the character value 0x00.

 

it needs to be done by keeping the port for more than one full character interval in the Break state.

 

But there is no strict requirement about how many bit intervals this should last other than that it is more than 9 bits unlike what LIN requires which expects 13 dominant bits followed by a a break bit in recessive state and then the sync byte 0x55. So unless your USB to LIN adapter has some built in smartness to generate that LIN break on its own. Your can’t expect this to work in the way you described. 

You need to at least consult the manual for your device to see how it can be made to sent that break. Without that. Manual we can’t help you more either.

 

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 10
(1,566 Views)

Hi man,

 


@man001 wrote:

I tried to use XNET but Labview doesn't recognize this as XNET driver. 


You aren't using NI hardware, so the NI driver will not recognize your hacker tool!

 

You might get some information from FTDI as that PCB seems to use an IC from them…

 

Here's a professional tool I used a lot: it comes with a manual.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(1,544 Views)

@GerdW wrote:

 

Here's a professional tool I used a lot: it comes with a manual.


They even have a LabVIEW driver for this hardware! Although I never used it and don't know about its quality. Unless your time costs nothing, that alone is already worth the higher price.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 10
(1,526 Views)

Hi,

 

I used it to connect LIN devices to a CAN bus. The RS232 port was used for configuration and debugging/monitoring. (After handling the first of them it was just plug-n-play.)

 

That device was robust enough to go on road inside trucks…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(1,519 Views)

Hi there. I know I'm not good enough for this. But today I got new info about this product. 

Set the serial port:
- Baud rate: 20000 (19200 should work too)
- Parity: None
- Data Bits: 8
- Stop Bits: 1

Using the serial port, you send bytes:

- 0x00 - this is LIN break pulse,
- 0x55 - transmission synchronization (based on this signal, the slave should adjust the appropriate baud rate)
- 0x10 - ID + XP
- Depending on the frame type, the Slave responds the message back to the Master or Master keeps sending messages to Slave. Then the CRC is sent after data
transmission (checksum). If data is sent to the Slave then the Master must calculate the CRC and send it to the Slave otherwise the Slave will reject the
incoming data.

 

I'm concern about - 0x10 - ID + XP. Anybody can help me?

 

0 Kudos
Message 9 of 10
(1,467 Views)

Hi man,

 


@man001 wrote:

I'm concern about - 0x10 - ID + XP. Anybody can help me?


Read the manual of that hardware, it should explain the meaning of "ID" and "XP". Without a manual we cannot help you!

 

Again: for less than 300€ you can get professional hardware with manuals (and drivers), that is known to be working. How much time do you want to spend on a "game/home tool" - and how much does that time cost you and your employer?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(1,456 Views)