Author Topic: Extracting unique identifiers and data from a CAN message.  (Read 7313 times)

Offline BRIan

  • PLUS+1 Expert
  • ****
  • Posts: 60
  • Karma: +3/-0
Extracting unique identifiers and data from a CAN message.
« on: June 24, 2024, 06:57:41 AM »
I have a CAN message that I want to extract information from:
AA 28 63 14 0 1 73 3
AA 28 61 19 0 1 73 3
AA 28 5F F5 0 1 73 3
AA 28 64 F6 0 1 73 3
AA 28 5F 18 0 1 73 3
AA 28 64 F3 0 1 73 3
AA 28 63 18 0 1 73 3
AA 28 61 15 0 1 73 3
AA 28 5F 22 0 1 73 3
AA 28 64 A2 0 1 73 3
AA 28 5F A4 0 1 73 3
AA 28 64 19 0 1 73 3
AA 28 63 33 0 1 73 3
AA 28 61 25 0 1 73 3
D2 is a unique identifier and D3 is it's value. I want to set up one array with unique identifiers eg 63,61,5F,64 and another array which updates live so the first values from this data would be 14,19,F5,F6 and they would change as new values came in.
Identifiers range from 01 to FF.
Can anyone help? I can't seem to get started.

Offline Lukey

  • PLUS+1 Expert
  • ****
  • Posts: 71
  • Karma: +8/-0
Re: Extracting unique identifiers and data from a CAN message.
« Reply #1 on: June 25, 2024, 06:57:26 AM »
You could write a Structured Text/C Code POU to complete this task
or
In the GUIDE/Page use a mixture of the Array components; Get Array Element or Copy of Array and then use Insert Array Elements to place the values into your new array