NI Home > Community > NI Discussion Forums
Reply
Member
aviadCielo
Posts: 26
0 Kudos
Accepted Solution

How to distinguish between frames that comes from my TX CAN Object and frames that comes from the network?

Hy,

 

I have a Can Object that transmit data to specific id.

I expect to get frame  from the network with similar id and data.

 

How would I know that the data arrived from the network?

(If I listen to the data from the CAN Interface, I can't distinguish between the data that I transmit and between the data that comes from the net) 

 

Thanks in advance,

Aviad

Active Participant
GPIB_Guru
Posts: 535
0 Kudos

Re: How to distinguish between frames that comes from my TX CAN Object and frames that comes from the network?

Start with the simple things: Hardware, Driver, OS, Programming Environment...

Member
aviadCielo
Posts: 26
0 Kudos

Re: How to distinguish between frames that comes from my TX CAN Object and frames that comes from the network?

Thankes.

I work with:

 

  • Hardware: PCI-CAN Series 1,
  • Driver: NI-CAN 2.7.3
  • OS: Windows xp
  • Programing environment: QT C++.
Active Participant
GPIB_Guru
Posts: 535
0 Kudos

Re: How to distinguish between frames that comes from my TX CAN Object and frames that comes from the network?

Since you are using NI-CAN Series 1, which doesn't support any self-reception, I presume you are using two CAN ports... one to do your normal transmission and one to listen to the frames from the CAN bus?

 

If this is the case, the only option that I see for you would be to compare the received payload with the transmitted payload to detect the frames that you send. This will only work if you send and receive different payloads, but that is probably something that is generally true. If that is false, then you really don't have any good option with Series 1 (or even Series 2) and NI-CAN.

 

We do have a different product, NI-XNET, which provides a self-reception setting (like Series 2 NI-CAN), but when you receive the frame it contains a flag that indicates if it was received from the network or was received via self-reception. This would obviously be the simplest (and probably only guaranteed) way to achieve your goal.