0

I am new to CANoe/CAPL.

I am trying to display the data of the received message onto a GUI. This will be a message that is 64 bytes, so I would like multi-line support. Thus far, all I have seen as an option for multi-line GUI box is the "CAPL Output View".

For instance, if I receive a message from 0x01333DDC, 00 00 10 AC DD; I want 00 00 10 AC DD to be printed on the GUI input window. I also want multi-line printing as the messages are 64 bytes.

I have tried:

  1. Assign message.byte() to a system variable, then use PutValueToControl()
  2. PutValueToControl(messageXxX)

In all cases, all 0 values are returned on the CAPL output view, although message received through trace window actually shows that there are non-zero values in the message data.

Thank you in advance for any comments/help,

Edit: Below is my code. This is done on a real CAN bus (not simulated) as there is an ECU connected that sends the message. The message is configured to 64 bytes in size and named msg_DATA_REQ_REC. It is stored in a system variable of int array 64 bytes named DATA_REQ_REC.

I am trying to output the message data content into a CAPL output view named Rx_DATA on a panel named "MONITOR_PANEL". Also, an LED indicator (LED_REC) is set to blink when the message is received.

on message DATA_REQ_REC                //When when DATA_REQ is received from other ECU on CAN
{
  //store received message data into system variable DATA_REQ_REC
  for (i = 0; i < 64; i++)
  {
    @MONITOR_PANEL::DATA_REQ_REC[i] = msg_DATA_REQ_REC.byte(i);
  }
  putValueToControl("MONITOR_PANEL", "Rx_DATA", "\r \r");
  
  //If the first byte is empty
  if (@MONITOR_PANEL::DATA_REQ_REC[0] == 0x00)
  {
    //do nothing
  }else
  {
    //display all 64 bytes of data in DATA_REQ_REC
  for (i = 0; i < 64; i++)  
  {
   putValueToControl("MONITOR_PANEL", "Rx_DATA", @MONITOR_PANEL::DATA_REQ_REC[i]);
  }
    putValueToControl("MONITOR_PANEL", "Rx_DATA", "\r \r");*/
  }

//need to move LED activation into else statement if want to blink only for APDU_REQ with data
  @MONITOR_PANEL::LED_REC = 1;       //Turn on Data Indicator LED
  setTimer(Timer_LED_REC, 200);  //set LED timer  
}

on timer Timer_LED_REC
{
 @MONITOR_PANEL::LED_REC = 0;        //Turn off Data Indicator LED
}
6
  • There is no message.byte() that takes no parameter, nor a PutValueToControl(...) with that signature. Please show your code. Commented Oct 18, 2023 at 9:09
  • @MSpiller, thank you for the comment. I added my code to the original post as "edit" since it exceeds character limits for a "comment". Commented Oct 18, 2023 at 17:42
  • What is the value of property Output mode of your control? Commented Oct 19, 2023 at 9:11
  • @MSpiller, the output mode is set to "Append". The message will be coming through repeatedly. I want to be able to see all receiving of this particular message when it has data content (when 1st byte is a non-zero value) for the entire session. Commented Oct 19, 2023 at 12:32
  • That all looks good. Which output do you get in the control? Nothing at all? Commented Oct 25, 2023 at 6:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.