Concatenating two bytes of a can frame with multiplexed message

26 Views Asked by At

I'm trying to write a script for vector canlayzer, I need to concatenating two bytes of a can frame with multiplexed message and conferring them in physical.

Is it possible ?

`

on message CAN_Multiplexed.*      //CAN frame multiplex
  if(this.CAN == 1)
    if(this.ID == 0x123)                    // ID mex multiplexed
      if(this.Byte1 < 4)                      // Check range multiplex
        if(this.Byte1 == 0)                  // Cases of multiplex
          byte1 = this.Byte2;
        else if(this.Byte1 == 1)
          byte2 = this.Byte2;



                                                      //Concatenate two bytes into a 16-bit value

on timer 100ms
  concatenatedValue = (byte1 << 8) | byte2



//esa to dec cconversion

for(i = 0; hexNumber[i] != '\0'; i++) 
        if(hexNumber[i] >= '0' && hexNumber[i] <= '9') {
            val = hexNumber[i] - 48;
        else if(hexNumber[i] >= 'a' && hexNumber[i] <= 'f') {
            val = hexNumber[i] - 97 + 10;
        else if(hexNumber[i] >= 'A' && hexNumber[i] <= 'F') {
            val = hexNumber[i] - 65 + 10;
        decimalNumber += val * pow(16, len);
   len--;`

physical output ???

0

There are 0 best solutions below