Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

copy data from CAN Chanel 1 and send that data in CAN chanel 2 using CAPL

Status
Not open for further replies.

GaneshM

Newbie level 2
Joined
Aug 21, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
40
"copy data from CAN Chanel 1 and send that data in CAN chanel 2 using CAPL". Hi all, I am at Starting level of CAPL programming.. i faced this question in my interview , could you please help in this?

Thanks in Advance
 

r2msrit

Newbie level 2
Joined
Apr 3, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
23
hi Ganesh,

This might be helpful


Code:
variables
{
message output_msg_name output_msg_obj;
int i;
}

on message CAN1.input_msg_name
{
  input_msg_name in_msg_obj;
  in_msg_obj = this;
  output_msg_obj.dlc = in_msg_obj.dlc;     // populate the dlc field for the output message
  output_msg_obj.CAN = 2;                     // Assign CAN Channel to the Output message
  for(i = 0; i< in_msg_obj.dlc ; i++)
   {  
      output_msg_obj.byte[i] = in_msg_obj.byte[i];    // Copy the Data in the input message received.
   }

 output(output_msg_obj);

}

Lemme know if this helps.

Thanks .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top