Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change CAN message payload length in XNET

Any news?

Is there a possibility to filter by ID read can messages by XNET? I have to determine the receiving time of a single can message without using timestamps, because they are different between PXI and the device that send me this message (PXI send a CAN message to the device and it answer with a CAN message). I am using Frame Input Stream and Frame Output Stream XNET sessions.

 

Bye.

0 Kudos
Message 11 of 16
(3,788 Views)

@hex_cro wrote:

Any news?


No. Unfortunately, I still don't understand the use case for this request. That doesn't mean it isn't valid, but without understanding the rationalle, I am not sure how to classify this. Do you want to do this for fault injection?

 


@hex_cro wrote:

 

Is there a possibility to filter by ID read can messages by XNET? I have to determine the receiving time of a single can message without using timestamps, because they are different between PXI and the device that send me this message (PXI send a CAN message to the device and it answer with a CAN message). I am using Frame Input Stream and Frame Output Stream XNET sessions..



Sorry. I don't know if I understand this either. You need to know the time you received a frame, but you don't want to look at the timestamp? I am not sure how to determine time otherwise. If you want filtering to detect a single frame, you can use a frame input session instead of a stream input session. This will only return data for one ID. However, to determine when a frame was received, you would still need to look at the timestamp.

0 Kudos
Message 12 of 16
(3,785 Views)

I am not using a frame input session because I have to transmit messages with a variable payload length and same ID. If I create two frame with same ID and different payload length, I have an error. What is wrong with my approach?

I have to send to the device messages with different payload length to communicate with it in diagnostic mode.

Now, I measure the time between transmission and receiving using MsTimer.

 

 

0 Kudos
Message 13 of 16
(3,782 Views)

Well, you need stream output to do the transmissions of different lengths, but you should be able to use frame input to do the reading.

0 Kudos
Message 14 of 16
(3,780 Views)

The problem is I have to change payload length without starting and stopping CAN session: is this possible?

0 Kudos
Message 15 of 16
(3,777 Views)

I think for input objects, if the received payload is < DB, you are okay. So if you set the DB length to 8 bytes, then any frames <= 8 bytes will be received and passed up to you.

0 Kudos
Message 16 of 16
(3,774 Views)