Go Down

Topic: [CAN bus] Tx data stored in ASCII file on SDcard (Read 2452 times) previous topic - next topic

kitamuort

Sep 30, 2014, 09:43 am Last Edit: Oct 01, 2014, 02:30 pm by kitamuort Reason: 1
Hi guys,

I already tried the find function on the forum but seems there's nothing related.
I did long search on internet about that but seems nobody have ever tried that before.

I want to simulate a CAN network node with arduino sending an .ASC text file log  previously recorded with a logger.
my idea is to use that shield:
https://www.sparkfun.com/products/10039
with arduino Uno

The target is to have a stand alone replay block

My question are:
1) Did somebody ever tried it before?
2) which kind of problem could i have? my  fear is the clock, if the clock is not enough fast I'll not able to send messages in real time.

Thank you in advance

pylon

What type of CAN node do you want to simulate? Usually the node is not just spitting out some data but interacts with another node, meaning it reacts on messages received from that node or sends some data read from sensors.

What logger logged that data? CAN messages often aren't human readable ASCII data. So you might have to interpret the data in the file first and therefor you have to know how the data was saved to be able to reconstruct the corresponding CAN stream.

kitamuort

I need a dummy node. I don't want interaction with the bus, just reply logged data.
I need it for a presentation.

The data file is in ASCII format, the Vector ASCII format.

pylon

Quote
The data file is in ASCII format, the Vector ASCII format.


Do you have a link to the specification of that format? ASCII is just a character encoding in 7 bits, so that's not a "format" for 8-bit data.

Quote
I need a dummy node. I don't want interaction with the bus, just reply logged data.
I need it for a presentation.


Does that mean that dummy node is the only device on the bus? No other device has to react on the data sent by the node? What kind of device should be simulated?

kitamuort


Do you have a link to the specification of that format? ASCII is just a character encoding in 7 bits, so that's not a "format" for 8-bit data.


sorry, I can't find specification but i can show you a real log:
[timestamp] [channel] [ID] [direction] [datalenght] [data fields 1...8] [additional info.... irrelevant]
Code: [Select]

   0.100898 2  3C0             Tx   d 4 00 00 00 00  Length = 172000 BitCount = 89 ID = 960
   0.200916 2  3C0             Tx   d 4 00 00 00 00  Length = 172000 BitCount = 89 ID = 960
   0.201167 2  6EA             Tx   d 7 00 00 00 00 00 00 00  Length = 224000 BitCount = 115 ID = 1770
   0.208381 2  601             Rx   d 8 40 00 01 01 00 00 00 00  Length = 240000 BitCount = 124 ID = 1537
   0.208651 2  6C7             Rx   d 8 01 00 00 00 06 00 00 00  Length = 238000 BitCount = 123 ID = 1735
   0.208950 2  601             Rx   d 8 10 42 01 01 00 00 00 00  Length = 236000 BitCount = 122 ID = 1537
   0.209202 2  62D             Rx   d 8 04 82 03 00 12 00 03 00  Length = 234000 BitCount = 121 ID = 1581
   0.209446 2  62F             Rx   d 8 04 42 03 00 11 00 04 01  Length = 228000 BitCount = 118 ID = 1583
   0.209695 2  630             Rx   d 8 03 C2 03 00 0F 00 04 04  Length = 232000 BitCount = 120 ID = 1584
   0.209939 2  631             Rx   d 8 04 C2 03 00 13 00 03 04  Length = 228000 BitCount = 118 ID = 1585
   0.217134 2  1FD             Rx   d 8 00 00 00 00 00 00 00 00  Length = 242000 BitCount = 125 ID = 509
   0.217398 2  30B             Rx   d 8 02 0D 00 00 00 00 00 80  Length = 236000 BitCount = 122 ID = 779


Does that mean that dummy node is the only device on the bus? No other device has to react on the data sent by the node? What kind of device should be simulated?


I mean that Arduino will be the restbus ( the whole vehicle) and I will have only one node receiving data from arduino, reacting to them, but I'm not interested to the traffic sent from this node.
I'm able to do postprocessing on the logging file so I can simulate (and then put the log on arduino) only the nodes I need.

pylon

I am not aware of any library that parses that format but it should be quite straightforward to do it yourself. To send out the data on the CAN bus you only need the MCP2515 library linked on the Sparkfun product page.


Go Up