07-21-2008 08:58 AM
07-22-2008 10:50 AM
My guess is that you need to send a full frame to your slave with ID 60. When the slave receives full, it looks at ID, NAD, PCI, SID and determines that it has received a request frame from the master. It should respond by transmitting a full (response) frame. (ID 61).
Thus you could use the LIN Master Send Full Frame and Receive Example, in order to receive the Slave Response Frame.
For the Future, perhaps the LIN spec is hgelpful?
DirkW
07-23-2008 04:29 AM
07-23-2008 02:14 PM
Hi,
Could you please run the modified example, to see whether or not your slave is answering with the desired dignostic frame. If not, could you double check your cabling and baudrate?
DirkW
07-24-2008 01:13 AM - edited 07-24-2008 01:18 AM
07-24-2008 02:27 PM
Ok, it could be that you have to send the Full Frame and then a header Frame to receive the response. See the attached VI and check this approach.
DirkW
07-30-2008 03:01 AM
Hi,
thanks for your help.
I have connected USB-8476 with my slave device.
Actually,My softeware is correct. only the diagnostic data I get from somebody else is incorrect. additionally,the ID of response frame should be 0x3D,no 0x7D.
for USB-8476 lin communication ,the arbitrationID is 6-bits identifier,not ID-field.So I should not convert 0x3D into 0x7D.
Best Regards!
10-09-2008 05:47 AM
Hello All,
I have a follow up question to this thread. I am communicating with a single slave using the USB 8476. The slave is a lin based sensor and is supposed to publish data. From my understanding of LIN, i have to issue a header frame and the slave will then generate the corresponding response. I use the "LIN Master Send Header Frame and Receive.vi" which is shipped with LabVIEW (8.0 in this case).
However, i keep on getting an error frame everytime I click the send header with the necessary arbitration ID (I want to read a frame with ID 0x22). The response is attatched as a screenshot. The first 4 bytes appear to be some kind of an error code. The last byte is always the arbitration ID of the frame (i tried with other IDs which should also generate frames containing data) Also the reponse lengths of these various frames varies. The error response is always 7 bytes or 4 as can be seen.
Could anyone please point out what I might be doing wrong. Could anyone also point out what these 4 byte error codes are for?? Are they part of the LIN standard or is it something my slave is sendng. The slave in question is a LIN 2.0 slave.
Regards,
Shailesh.
10-09-2008 08:39 AM
Hi,
You are right the error has a meaning and the explanation can be found in the NI-CAN driver manual. (Chapter 10- page 10-102) .This chapter explains the LIN error codes and the hexC008 error means that the received checksum byte was not correct.
LIN knows two different checksum calculations classic and enhanced. By default the driver uses the classic calculation. It could be that your devices is using the enhanced checksum calculation.
In this case you would need to use the set attribute function call to switch to enhanced checksum calculation(same manual page 10-97)
Another reason could be a bug the driver version 2.4 and 2.5 did in fact calculate the checksum incorrect. In this case an update to a leter version would fix this issue.
The hex1040 error is received when a timeout occurs, in this case for a sync frame.
That could be related to the other error.
DirkW
10-09-2008 09:16 AM
Hello Dirk,
thanks for the reply.
You are right with the checksum error. I came acrooss another post which said that this shows the checksum necessary and the checksum vailable. While LIN 2.0 slaves send enhanced checksums, the VIs use classic checksums. Setting the checksum attribute did the trick.
Thanks again,
Shailesh.