Hi all,
I'm building a CAN message decoder. Using the example CAN Receive.vi, I get 2-d array of the messages/strings. For each message, based on its ID, I'd decode the message accordingly, i.e. extract the variables contained in the data part of message. The layout of the data part of the message is stored in an excel file with 3 fields: start bit, stop bit and signal_name.
For example: the excel file would contain something like:
3, 0, v1
4, 4, v2
6, 5, v3
...
The for each CAN message, after matching the ID, I'd open the corresponding excel file and get the layout of the data part of the message. Based on the start and stop bits, I'd assign the corresponding bit(s) to the corresponding variable name, e.g. 4 bits from bit 3 to 0 will be assigned to variable v1.
Can anyone suggest a simple way to do it? I'm able to get the CAN message and the contents of the excel table. Now I need help in using the info to decode the data part of the message (parse the string) and assigned them to the corresponding variables.
Thanks,
-Ep