Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

RTSI pulse using a CAN frame

Hi,
I'm currently using the ncWriteMult function (we can't use the ncWrite function because our application simulates problems of transmission on the CAN i.e. stopping an exact amount a frames or sending frames with the wrong DLC => we need a good accuracy so we can't use for example ncAction(NC_OP_ START / NC_OP_ STOP) to stop N frames and then restart => our application fills a buffer with timestamped frames and send them with ncWriteMult).
The application has to synchronize those actions with DAQ so we want to use RTSI. We want, for example, stop 50 0x203ID-frames, restart them and 100ms after send a RTSI pulse for DAQ synchronisation (to toggle an analog signal, that DAQ part works).
As the application fills the buffer passed to ncWriteMult with timestamped frames, we 'd like to put special virtual CAN timestamped frame in that buffer that would only output a RTSI pulse.
Is it possible to do that ? I tried to use the the NC_FRMTYPE_RTSI but this type seems to be only used to store RTSI events received by the CAN card in the read queue doesn't it ?

Thanks for your replies.

Best Regards.
0 Kudos
Message 1 of 5
(4,588 Views)

Hi JCX

Well if i understand your request, you need to output a RTSI Pulse 100 ms after you sent 50 Frames using the Write mult net function?

The easiest way to do so, would be using the Confog Net with RTSI to configure the RTSI output on call of nc action. Thus you will have a single RTSI Pulse on every call of nc action and you can configure this output 100 ms after your write mult  has written the last frame, controlled by using a wait for write success.

See the attached example, for details.

I noticed one problem with this solution: The open Function  initializes a start trigger pulse on the specified RTSI Line, thus you will see one RTSI Pulse on call of ncopen, before you enter the While loop to call the write mult. We are working on this to fix it for the next driver.

DirkW

0 Kudos
Message 2 of 5
(4,578 Views)
Hi DirkW,

I'm affraid I was not clear enough about my problem. Actually, I use ncWriteMult continuously in a loop. Our application is supposed to simulate several ECUs that do not work properly (they stop sending frames, send X frames with the wrong DLC, stop sending frames during Xms) in order to check a real ECU behavior.
My program works that way : I prepare a buffer of frames to write, I call ncWriteMult to write it, prepare the next buffer of frames, wait until enough space in the CAN queue is available, call ncWriteMult and so on. The problem is that one simulated ECU is supposed to synchronize an output according to CAN frames in the buffer I write.
For example, the output is toggled 40ms after a frame is stopped or 100ms after a frame is sent with the wrong DLC or 500ms after a frame starts...
So I wanted to know if it is possible to put a "special timestamped frame" in my buffer that would output a RTSI pulse.

I did not write it but I'm using LabWindows/CVI.

Thanks.
0 Kudos
Message 3 of 5
(4,566 Views)
Hi,

Do you have any news about my problem ?
Do you think it would be possible for you to make the NC_FRMTYPE_RTSI work (i.e. pulse or toggle a RTSI line) when writing this frame on a CAN interface.

Best Regards.
0 Kudos
Message 4 of 5
(4,530 Views)

Hi,

CVI brings an example showing how to output an RTSI Pulse on CAN transmit. This works also with the Write mult. And if you set the Transmit Mode to Timestamped Transmit , you can delay the message send and thus also the RTSI pulse.

 

DirkW

0 Kudos
Message 5 of 5
(4,485 Views)