Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-CAN Periodic Waveform in XNET

I'm trying to create a CAN message that sends the following data on the same message ID:

 

01 02 03 04 05 06 07 01

01 02 03 04 05 06 07 02

01 02 03 04 05 06 07 03

...

01 02 03 04 05 06 07 0F

01 02 03 04 05 06 07 01

01 02 03 04 05 06 07 02

01 02 03 04 05 06 07 03

... and so on

 

So the same 16 item sequence over and over until I tell it to stop.

 

For the old NI-CAN drivers I was able to accomplish this by using net and obj (see Sample NI-CAN Periodic Send.vi). Don't mind the huge While loop around everything. Sometimes I get a write buffer overflow and then when I close my handles and try again, no problems.

 

The closest thing I can find for XNET is a single transmission of the 16 items (see Sample XNET Code.vi). This was a pain because I had to programatically create the frame. I just can't seem to find any correlation between the periodic waveform tx and XNET. Yes you can send waveforms but now those are actual values that need to be sent over and over again.

 

Also, the main point of doing it this way is to have the ability to set the CAN and forget it (i.e. not having to call the write in a while loop). 

 

Any help would be appreciated,

Thanks

Download All
0 Kudos
Message 1 of 2
(5,990 Views)

If you are going to test the Sample XNET Code.vi you need to change the Timing Type in the CAN Frame cluster to "Cyclic Data" and the transmit time to something other than 0 (I put it to 0.1, 10 Hz).

0 Kudos
Message 2 of 2
(5,985 Views)