Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

cannot see master frames LIN

Hello,

 

I'm implementing an interface using NI's LIN platform. Right now, I'm having trouble with the schedule change. I'm writing a schedule and at the same time I'm continuously fetching messages from the bus. I only receive messages that are transmited by the slave and I would like to also get the messages that the master sends.. I know that because I use Vector's Canoe to double check. If I send the schedule via Canoe, I also receive messages that the master sends. In my opinion, Labview does not interpret correctly the LDF. Does anyone know how to solve this? And is it possible to stop a schedule? 

0 Kudos
Message 1 of 9
(5,331 Views)

Hello biroo,

 

When you say you are fetching messages from the bus, are you using the XNET Read VI to do so or a different method? Also, when you say stop a schedule, are you wanting to end the current schedule and start a new one or end the session entirely?

 

Regards,

 

Ryan

Ryan P.
CLA
0 Kudos
Message 2 of 9
(5,297 Views)

Hi, Ryan,

 

Yes, I am using the XNET Read VI. Regarding my need to stop the current schedule, I just want to end it, without closing the session and without substituting it for another.

0 Kudos
Message 3 of 9
(5,287 Views)

In LIN, your XNET interface is going to act as the Master and transmit frames according to the schedule. When you use the XNET Read VI, it will read in the responses from the Slaves on the LIN bus. Because this is one XNET interface, the XNET Read VI does not inherently read its own transmissions through the XNET Read VI. However, you can make use of the XNET Bus Monitor to see all of the activity on the bus. This will show the Master request frames and the Slave responses.

 

As for stopping the schedule, you can use the XNET Stop VI to stop the interface while keeping the session intact, if you just want to stop the communication indefinitely. You can always then call the XNET Start VI to continue without having to remake the session.

 

Is there a specific reason you are trying to read the Master request frames using the XNET Read VI?

Ryan P.
CLA
0 Kudos
Message 4 of 9
(5,267 Views)

I have used the Bus Monitor also and it shows only the slave responses. This is why I think Labview does not interpret my LDF file correctly. The reason I'm trying to read the Master request frames is that I have to build a bus monitor. Yeah, I know this is redundant, with NI already offering one, but this is the job.

0 Kudos
Message 5 of 9
(5,260 Views)

Oh, and another thing: after I use the XNET Write block to change my schedule, do I have to use the block again to write frames, or just changing the schedule is enough? 

0 Kudos
Message 6 of 9
(5,252 Views)

In LIN, when the Master makes a request it only sends out the header information for the frame onto the LIN bus. The appropriate slave, dictated by the header information's ID, responds by putting the data portion of the same frame onto the bus as its response. Therefore, I'm not sure what you mean by reading the Master frame, since the Master Request and Slave Response are one frame.

 

You can parse the header information out of the frame to see what the Master sent out for the Break, Sync, and ID bits, but this is the only component written by the Master.

 

I recommend looking over the article linked below. It should discuss this in more detail.

 

Introduction to the Local Interconnect Network (LIN) Bus:

http://www.ni.com/white-paper/9733/en/

Ryan P.
CLA
Message 7 of 9
(5,238 Views)

I thought that I only needed to write a schedule change and LV would take care of everything else, but the LIN Schedule has only empty frames from what I understood. It is necessary to take the frames and to add payload to it. The LIN schedule is only used as a pattern.

0 Kudos
Message 8 of 9
(5,231 Views)

You are correct that when you change the schedule in LIN, a new set of frame headers are transmitted. Since they are headers, they do not have any kind of payload associated with them until the appropriate node on the bus replies with the payload, similar to my description in my previous response. Along with the previous article I linked, take a look at the first one that I have added below. It has a little more on how XNET handles schedule changes. Just go to the section on LIN. I'm also going to point you to our XNET User Manual. It covers every available function and operation that can be done with LIN, and explains them in more detail. I think it will give you quicker answers to your questions.

 

Getting Started with the NI-XNET API for LabVIEW:

http://www.ni.com/white-paper/12375/en/#toc7

 

NI-XNET Hardware and Software Manual:

http://www.ni.com/pdf/manuals/372840e.pdf

Ryan P.
CLA
0 Kudos
Message 9 of 9
(5,201 Views)