I'm new to CANoe and CAPL, currently using Vector CANoe 16 SP2 Demo version. I'm able to send a 8 bytes of CAN message as shown below with the help of CAPL script without CAN database file.
/*@!Encoding:1252*/
includes
{
}
variables
{
message 0x01 msg1;
msTimer tm;
}
on start
{
setTimer(tm,10);
}
on timer tm
{
Send_msg_1();
setTimer(tm,10);
}
void Send_msg_1()
{
int i;
msg1.msgChannel=1;
msg1.dlc=8;
for(i=0;i<8;i++)
{
msg1.byte(i)=0x1;
}
output(msg1);
}
Now, I want to send 8 bytes of lin frame with CAPL without the LDF file. I've written the following code for it
/*@!Encoding:1252*/
includes
{
}
variables
{
linFrame 0x01 msg1;
msTimer tm;
}
on start
{
setTimer(tm,10);
}
on timer tm
{
msg1();
setTimer(tm,10);
}
void msg1()
{
int i;
msg1.msgChannel=1;
msg1.dlc=8;
for(i=0;i<8;i++)
{
msg1.byte(i)=0x1;
}
msg1.rtr=0;
output(msg1);
msg1.rtr=1;
output(msg1);
write("Frame Transmitted");
}
But, I'm not sure if its getting really transmitted because it is showing like this in trace window
If its not correct. Please let me know the correct way of transmitting a lin frame in CANoe with CAPL scripting.
Thanks in advance :)