03-26-2010 02:47 AM
Hi,
I am using a USB 8476s to communicate to a Slave node in a LIN network.The slave is a light switch module used in vehicles. I am using the example i found in Labview examples "LIN Master Send Header Frame.vi " to communicate to the slave. But when i run the code i keep getting an error code 10 80 02 00. I cannot find this error code anywhere in the LABVIEW help. Can you please tell me what this error means ?
Also I need to be able to communicate to 6 slave nodes with the same id. Right now I am using one USB 8476s to communicate to one slave node. Can you tell me how i can communicate to multiple slave nodes with the same id,at the same time.
I am attaching the labview code, and also the front panel screen shot with the error code.
Thank you.
03-26-2010 08:20 AM
There was another discussion that is similar, but I don't think there was a resolution
http://forums.ni.com/ni/board/message?board.id=6170&message.id=5866&query.id=59827
The basic issue is that you are trying to write a break (as a master) and you are getting a timeout when trying to self-receive the break command. This is strange and my gut feel is that your transceiver is in an error state or something.
If you disconnect the slave from the LIN network, do you still get this error? Trying to isolate where the error is coming from - the bus or the USB-8476.
Could you have too much termination on the bus? You can try to disable the onboard termination with the checkbox.
Do you have any other USB-8476 boxes that you could try to see if the problem follows the bus or the box?
As for your second question. If you are just sending headers, you are expecting the device to respond. The LIN spec only allows one slave to repond to an unconditional ID (event triggered IDs are different). I don't expect that you would get 6 of them on the bus correctly as this is a direct violation of LIN. If you are just broadcasting to them, it would probably work.
03-26-2010 09:36 AM
Hi,
Thank you for the reply. I realized the error was with my Slave node. It was not functioning correctly. I have now replaced it with another and its functioning correctly.
I am new to LIN networks and am not very sure about the communication between the master and slave nodes. Can the master send commands to the slave other than the header frame? I need to send a comand to the slave to light up the leds present on it, i am not sure how the master can send any frame other than the header frame. Also how can i wake up a lin bus that is in sleep mode ?
I know that slaves with same id cannot respond at the same time on a lin bus, but i want to know if there is any other product i can use that will allow me to send header frames to 6 slaves and also receive response from them ?
Thank you.
03-26-2010 10:27 AM
With the USB-8476, you woudl send a "Full Frame".... Bascially, LIN has one master and N slaves. The USB-8476 contains 1 master and 1 slave. The slave contains a table that has the reponse for each ID that it plans to publish. NI-CAN has three transmission options:
Update Response - this just changes the data in the slave response table.
Header - this causes the master to send a header on the bus. A slave that is setup to respond to the header will publish the data on the bus. Only one slave shall publish a response under normal situations. If the 8476 slave is setup to publish for a particular ID, it will transmit the data, otherwise, it will subscribe and listen to a different slave publishing.
Full Frame - This is essentially a combination of the two. IT will update the response and then send the header. The expectation is that the onboard slave will respond. This is the easiest way to send a frame to your slave.
To wake a LIN bus, you just need to send a header frame or a break.
Appendix C in the NI-CAN manual is a decent overview of LIN. As is Chapter 9, "Frame API Basic Programming Model for LIN". The latter chapter discusses masters, slaves, sleep, and wakeup.
You can send and receive to 6 different slaves with the 8476, but they cannot all respond at the same time. If they are configured to transmit a response to different IDs, it should work great. Otherwise, no tool would work other than having 6 different LIN buses running in parallel. (unless I am misunderstanding the problem)
03-27-2010 08:17 AM
Ok thank you for the reply. Now I have a better idea about the master slave relation in LIN network.
I think the only solution to having 6 slaves with same id and one master is running 6 lin bus in parallel. I also tried lookin for some other tools available. But having 6 lin bus in parallel is the best option i could come up with.
Thank you again for the help.
03-29-2010 02:54 AM
Hi GPIB Guru,
Can you please tell me, what is the data suppose to be in the code "LIN master send full frame and data.vi" from the labview examples. I am not able to understand what this data is suppose to be ? Is the master suppose to this data or the slave updates this data ? I dont get anything in this data frame. As i understand, in ncWRITEnet.vi if the isremote is 17, then the data is ignored, and if the isremote is 18 the data is published, but i am not getting anything when i make isremote 18. I get the error 10 40 01 02.
Also now i get a new error 10 40 01 02, initially when i start to run the code for the first time, also if the bus is inactive and i start to send header frame first i get this error and then it will give me the correct output from the slave. What could be the reason for this error ? I use labview 8 and ni can 2.5.2
I am attaching the code i am using, and also a screen shot of the error i am getting.
Can you tell me how i can solve this ?
Thank You