Dataset Viewer
instruction
stringlengths 36
156
| input
stringlengths 0
308
| output
stringlengths 31
5.52k
| prompt
stringlengths 282
5.83k
|
---|---|---|---|
Create a CAPL script to measure messages | 0x123 | includes{
}
variables{
}
on message CAN1.0x123 {
write("Receive message 0x123");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL script to measure messages
### Input:
0x123
### Response:
includes{
}
variables{
}
on message CAN1.0x123 {
write("Receive message 0x123");
}
|
Create a CAPL Script to Engine Information check | ICE : ENG_EngSta
HEV : HCU_HevRdySta
EV : VCU_EvDrvRdySta
IGN : BCM_Ign1InSta | includes{
}
variables{
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
}
void EngCheck()
{
Ice_engsta = getSignal(ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
on start {
EngCheck()
if (ENG == 2) {write(Engine is RUN!);}
else if (ENG == 1) {write(Engine is IGN ON!);}
else {write(Engine is OFF!);}
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Engine Information check
### Input:
ICE : ENG_EngSta
HEV : HCU_HevRdySta
EV : VCU_EvDrvRdySta
IGN : BCM_Ign1InSta
### Response:
includes{
}
variables{
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
}
void EngCheck()
{
Ice_engsta = getSignal(ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
on start {
EngCheck()
if (ENG == 2) {write(Engine is RUN!);}
else if (ENG == 1) {write(Engine is IGN ON!);}
else {write(Engine is OFF!);}
}
|
Creating a CAPL Script to Multiple Test Cases | includes{
}
variables{
}
testcase TC01(){
write(Start TC01);
}
testcase TC02(){
write(Start TC02);
}
testcase TC03(){
write(Start TC03);
}
void MainTest (){
TC01();
TC02();
TC03();
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Creating a CAPL Script to Multiple Test Cases
### Input:
### Response:
includes{
}
variables{
}
testcase TC01(){
write(Start TC01);
}
testcase TC02(){
write(Start TC02);
}
testcase TC03(){
write(Start TC03);
}
void MainTest (){
TC01();
TC02();
TC03();
}
|
|
Create a CAPL script for Seedkey in diagnostic communication | ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7B6 | includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
testcase Seedkey()
{
for (i = 0; i <= 5; i++)
{
EngCheck();
if (ENG == 1)
{
setLogFileName("Seedkey{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
reqMsg_0x7B6(0x02, 0x10, 0x03);
reqMsg_0x7B6(0x02, 0x27, 0x01);
testWaitForTimeout(3000);
stopLogging();
break;
}
else
{
write ("Please make it IGN ON!");
testWaitForTimeout(10000);
}
}
}
on message CAN1.0x700-0x7ff, 0x5D0,0x5D1, 0x5D8, 0x5D9, 0x5AA
{
if(this.id == 0x7BE && this.byte(0) == 0x03 && this.byte(1) == 0x7F && this.byte(2) == 0x27 && this.byte(3) == 0x12) { write("0x7BE Receive message"); }
}
void MainTest ()
{
startLogging();
stopLogging();
write("SEEDKEY SBW Test");
Seedkey();
write("---------------------------------");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL script for Seedkey in diagnostic communication
### Input:
ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7B6
### Response:
includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
testcase Seedkey()
{
for (i = 0; i <= 5; i++)
{
EngCheck();
if (ENG == 1)
{
setLogFileName("Seedkey{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
reqMsg_0x7B6(0x02, 0x10, 0x03);
reqMsg_0x7B6(0x02, 0x27, 0x01);
testWaitForTimeout(3000);
stopLogging();
break;
}
else
{
write ("Please make it IGN ON!");
testWaitForTimeout(10000);
}
}
}
on message CAN1.0x700-0x7ff, 0x5D0,0x5D1, 0x5D8, 0x5D9, 0x5AA
{
if(this.id == 0x7BE && this.byte(0) == 0x03 && this.byte(1) == 0x7F && this.byte(2) == 0x27 && this.byte(3) == 0x12) { write("0x7BE Receive message"); }
}
void MainTest ()
{
startLogging();
stopLogging();
write("SEEDKEY SBW Test");
Seedkey();
write("---------------------------------");
}
|
Create CAPL script for startup conditions prohibited in diagnostic communications | ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7B6 | includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
testcase Eng_condition()
{
setLogFileName("Eng_condition{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
testWaitForTimeout(1000);
ChkENG = 0;
for (i=0; i < 10; i++)
{
EngCheck();
if (ENG == 1 && (ChkENG == 0 || ChkENG == 2))
{
write("IGN ON State!");
reqMsg_0x7B6(0x02,0x10,0x02);
testWaitForTimeout(1000);
reqMsg_0x7B6(0x02,0x11,0x01);
testWaitForTimeout(1000);
if (ChkENG == 0)
{
ChkENG = 1;
}
else if (ChkENG == 2)
{
ChkENG = 3;
}
}
if (ENG == 1 && ChkENG == 1)
{
write("Please Make it ENG RUN state!");
EngCheck();
testWaitForTimeout(10000);
}
if (ENG == 2 && (ChkENG == 0 || ChkENG == 1))
{
write("ENG RUN state!");
reqMsg_0x7B6(0x02,0x10,0x02);
testWaitForTimeout(1000);
reqMsg_0x7B6(0x02,0x11,0x01);
testWaitForTimeout(1000);
if (ChkENG == 0)
{
ChkENG = 2;
}
else if (ChkENG == 1)
{
ChkENG = 3;
}
}
if (ENG == 2 && ChkENG == 2)
{
write("Please Make it IGN ON state!");
EngCheck();
testWaitForTimeout(10000);
}
if (ENG == 3)
{
write("Please Make it IGN ON or ENG RUN State!");
}
if (ChkENG == 3)
{
continue;
}
}
testWaitForTimeout(500);
stopLogging();
}
on message CAN1.0x700-0x7ff, 0x5D0,0x5D1, 0x5D8, 0x5D9, 0x5AA
{
if(this.id == 0x7BE && this.byte(0) == 0x06 && this.byte(1) == 0x50 && this.byte(2) == 0x02) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x51 && this.byte(2) == 0x01) { write("0x7BE Receive Message"); }
}
void MainTest ()
{
startLogging();
stopLogging();
write("SBW Eng_condition Test");
Eng_condition();
write("---------------------------------");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create CAPL script for startup conditions prohibited in diagnostic communications
### Input:
ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7B6
### Response:
includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
testcase Eng_condition()
{
setLogFileName("Eng_condition{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
testWaitForTimeout(1000);
ChkENG = 0;
for (i=0; i < 10; i++)
{
EngCheck();
if (ENG == 1 && (ChkENG == 0 || ChkENG == 2))
{
write("IGN ON State!");
reqMsg_0x7B6(0x02,0x10,0x02);
testWaitForTimeout(1000);
reqMsg_0x7B6(0x02,0x11,0x01);
testWaitForTimeout(1000);
if (ChkENG == 0)
{
ChkENG = 1;
}
else if (ChkENG == 2)
{
ChkENG = 3;
}
}
if (ENG == 1 && ChkENG == 1)
{
write("Please Make it ENG RUN state!");
EngCheck();
testWaitForTimeout(10000);
}
if (ENG == 2 && (ChkENG == 0 || ChkENG == 1))
{
write("ENG RUN state!");
reqMsg_0x7B6(0x02,0x10,0x02);
testWaitForTimeout(1000);
reqMsg_0x7B6(0x02,0x11,0x01);
testWaitForTimeout(1000);
if (ChkENG == 0)
{
ChkENG = 2;
}
else if (ChkENG == 1)
{
ChkENG = 3;
}
}
if (ENG == 2 && ChkENG == 2)
{
write("Please Make it IGN ON state!");
EngCheck();
testWaitForTimeout(10000);
}
if (ENG == 3)
{
write("Please Make it IGN ON or ENG RUN State!");
}
if (ChkENG == 3)
{
continue;
}
}
testWaitForTimeout(500);
stopLogging();
}
on message CAN1.0x700-0x7ff, 0x5D0,0x5D1, 0x5D8, 0x5D9, 0x5AA
{
if(this.id == 0x7BE && this.byte(0) == 0x06 && this.byte(1) == 0x50 && this.byte(2) == 0x02) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x51 && this.byte(2) == 0x01) { write("0x7BE Receive Message"); }
}
void MainTest ()
{
startLogging();
stopLogging();
write("SBW Eng_condition Test");
Eng_condition();
write("---------------------------------");
}
|
Create CAPL scripts to standardize communications for diagnostic communications | ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7DF | includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send message", a, b, c);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
output(reqMsg);
write("0x7DF %x %x Send message", a, b);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b, byte c)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7DF %x %x %x Send message", a, b, c);
testWaitForTimeout(500);
}
testcase standardize_comm()
{
for (i = 0; i <= 5; i++)
{
EngCheck();
if (ENG == 1)
{
setLogFileName("standardize_comm{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
reqMsg_0x7DF(0x02, 0x01, 0x00);
reqMsg_0x7DF(0x01, 0x00);
reqMsg_0x7DF(0x01, 0x01);
reqMsg_0x7DF(0x01, 0x02);
reqMsg_0x7DF(0x01, 0x03);
reqMsg_0x7DF(0x01, 0x04);
reqMsg_0x7DF(0x01, 0x05);
reqMsg_0x7DF(0x01, 0x06);
reqMsg_0x7DF(0x01, 0x07);
reqMsg_0x7DF(0x01, 0x08);
reqMsg_0x7DF(0x01, 0x09);
reqMsg_0x7DF(0x01, 0x0A);
reqMsg_0x7DF(0x01, 0x0B);
reqMsg_0x7DF(0x01, 0x0C);
reqMsg_0x7DF(0x01, 0x0D);
reqMsg_0x7DF(0x01, 0x0E);
reqMsg_0x7DF(0x01, 0x0F);
testWaitForTimeout(3000);
stopLogging();
write("Check message non-response!");
break;
}
else
{
write ("Please Make it IGN ON State!");
testWaitForTimeout(10000);
}
}
}
void MainTest ()
{
startLogging();
stopLogging();
write("SBW standardize communications Test");
standardize_comm();
write("---------------------------------");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create CAPL scripts to standardize communications for diagnostic communications
### Input:
ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7DF
### Response:
includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send message", a, b, c);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
output(reqMsg);
write("0x7DF %x %x Send message", a, b);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b, byte c)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7DF %x %x %x Send message", a, b, c);
testWaitForTimeout(500);
}
testcase standardize_comm()
{
for (i = 0; i <= 5; i++)
{
EngCheck();
if (ENG == 1)
{
setLogFileName("standardize_comm{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
reqMsg_0x7DF(0x02, 0x01, 0x00);
reqMsg_0x7DF(0x01, 0x00);
reqMsg_0x7DF(0x01, 0x01);
reqMsg_0x7DF(0x01, 0x02);
reqMsg_0x7DF(0x01, 0x03);
reqMsg_0x7DF(0x01, 0x04);
reqMsg_0x7DF(0x01, 0x05);
reqMsg_0x7DF(0x01, 0x06);
reqMsg_0x7DF(0x01, 0x07);
reqMsg_0x7DF(0x01, 0x08);
reqMsg_0x7DF(0x01, 0x09);
reqMsg_0x7DF(0x01, 0x0A);
reqMsg_0x7DF(0x01, 0x0B);
reqMsg_0x7DF(0x01, 0x0C);
reqMsg_0x7DF(0x01, 0x0D);
reqMsg_0x7DF(0x01, 0x0E);
reqMsg_0x7DF(0x01, 0x0F);
testWaitForTimeout(3000);
stopLogging();
write("Check message non-response!");
break;
}
else
{
write ("Please Make it IGN ON State!");
testWaitForTimeout(10000);
}
}
}
void MainTest ()
{
startLogging();
stopLogging();
write("SBW standardize communications Test");
standardize_comm();
write("---------------------------------");
}
|
Create CAPL scripts to Reprogram for diagnostic communications | ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7DF 0x7B6 | includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
output(reqMsg);
write("0x7DF %x %x Send Message", a, b);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b, byte c, byte d)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
reqMsg.byte(3) = d;
output(reqMsg);
write("0x7DF %x %x %x %x Send Message", a, b, c, d);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b, byte c)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7DF %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
testcase Reprogram()
{
for (i = 0; i <= 5; i++)
{
EngCheck();
if (ENG == 1)
{
setLogFileName("Reprogram{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
reqMsg_0x7DF(0x02, 0x10, 0x03);
testWaitForTimeout(1000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(6000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(3000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
testWaitForTimeout(6000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(3000);
reqMsg_0x7DF(0x02, 0x3E, 0x00);
testWaitForTimeout(6000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(3000);
reqMsg_0x7DF(0x03, 0x28, 0x00, 0x01);
testWaitForTimeout(6000);
reqMsg_0x7B6(0x02, 0x10, 0x03);
testWaitForTimeout(6000);
reqMsg_0x7B6(0x02, 0x27, 0x11);
testWaitForTimeout(3000);
stopLogging();
break;
}
else
{
write ("Please Make it IGN ON State");
testWaitForTimeout(10000);
}
}
}
on message CAN1.0x700-0x7ff, 0x5D0,0x5D1, 0x5D8, 0x5D9, 0x5AA
{
if(this.id == 0x7BE && this.byte(0) == 0x06 && this.byte(1) == 0x50 && this.byte(2) == 0x03) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x68 && this.byte(2) == 0x03) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x68 && this.byte(2) == 0x03) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x7E && this.byte(2) == 0x00) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x68 && this.byte(2) == 0x00) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x03 && this.byte(1) == 0x7F && this.byte(2) == 0x27 && this.byte(3) == 0x7F) { write("0x7BE Receive Message"); }
}
void MainTest ()
{
startLogging();
stopLogging();
write("SBW Reprogram Test");
Reprogram();
write("---------------------------------");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create CAPL scripts to Reprogram for diagnostic communications
### Input:
ECU : SBW
Receive Message : 0x7BE
Send Message : 0x7DF 0x7B6
### Response:
includes
{
}
variables
{
message * reqMsg;
byte Ice_engsta;
byte Hev_engsta;
byte Ev_engsta;
byte Ign_sta;
int ENG;
int ChkENG;
int i;
}
void EngCheck()
{
Ice_engsta = getSignal(CAN1::EMS::EMS_02_10ms::ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(CAN1::FCU::VCU_01_10ms::VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
void reqMsg_0x7B6(byte a, byte b, byte c)
{
reqMsg.id = 0x7B6;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7B6 %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
output(reqMsg);
write("0x7DF %x %x Send Message", a, b);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b, byte c, byte d)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
reqMsg.byte(3) = d;
output(reqMsg);
write("0x7DF %x %x %x %x Send Message", a, b, c, d);
testWaitForTimeout(500);
}
void reqMsg_0x7DF(byte a, byte b, byte c)
{
reqMsg.id = 0x7DF;
reqMsg.dlc = 8;
reqMsg.BRS = 0;
reqMsg.FDF = 1;
reqMsg.byte(0) = a;
reqMsg.byte(1) = b;
reqMsg.byte(2) = c;
output(reqMsg);
write("0x7DF %x %x %x Send Message", a, b, c);
testWaitForTimeout(500);
}
testcase Reprogram()
{
for (i = 0; i <= 5; i++)
{
EngCheck();
if (ENG == 1)
{
setLogFileName("Reprogram{IncMeasurement}_{Date}_{Time}.blf");
startLogging();
reqMsg_0x7DF(0x02, 0x10, 0x03);
testWaitForTimeout(1000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(6000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(3000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
testWaitForTimeout(6000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(3000);
reqMsg_0x7DF(0x02, 0x3E, 0x00);
testWaitForTimeout(6000);
reqMsg_0x7DF(0x02, 0x10, 0x03);
reqMsg_0x7DF(0x03, 0x28, 0x03, 0x01);
testWaitForTimeout(3000);
reqMsg_0x7DF(0x03, 0x28, 0x00, 0x01);
testWaitForTimeout(6000);
reqMsg_0x7B6(0x02, 0x10, 0x03);
testWaitForTimeout(6000);
reqMsg_0x7B6(0x02, 0x27, 0x11);
testWaitForTimeout(3000);
stopLogging();
break;
}
else
{
write ("Please Make it IGN ON State");
testWaitForTimeout(10000);
}
}
}
on message CAN1.0x700-0x7ff, 0x5D0,0x5D1, 0x5D8, 0x5D9, 0x5AA
{
if(this.id == 0x7BE && this.byte(0) == 0x06 && this.byte(1) == 0x50 && this.byte(2) == 0x03) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x68 && this.byte(2) == 0x03) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x68 && this.byte(2) == 0x03) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x7E && this.byte(2) == 0x00) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x02 && this.byte(1) == 0x68 && this.byte(2) == 0x00) { write("0x7BE Receive Message"); }
if(this.id == 0x7BE && this.byte(0) == 0x03 && this.byte(1) == 0x7F && this.byte(2) == 0x27 && this.byte(3) == 0x7F) { write("0x7BE Receive Message"); }
}
void MainTest ()
{
startLogging();
stopLogging();
write("SBW Reprogram Test");
Reprogram();
write("---------------------------------");
}
|
Create a CAPL Script to Print a Write Window When you start measurement | Hello World | on start
{
write("Hello World"); |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Print a Write Window When you start measurement
### Input:
Hello World
### Response:
on start
{
write("Hello World");
|
Create a CAPL Script to If statement | void EngCheck()
{
Ice_engsta = getSignal(ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to If statement
### Input:
### Response:
void EngCheck()
{
Ice_engsta = getSignal(ENG_EngSta);
Hev_engsta = getSignal(HCU_HevRdySta);
Ev_engsta = getSignal(VCU_EvDrvRdySta);
Ign_sta = getSignal(BCM_Ign1InSta);
if (Ice_engsta == 0x01 || Hev_engsta == 0x01 || Ev_engsta == 0x01)
{ ENG = 2; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x01)
{ ENG = 1; }
else if ((Ice_engsta == 0x00 && Hev_engsta == 0x00 && Ev_engsta == 0x00) && Ign_sta == 0x00)
{ ENG = 0; }
}
|
|
Create a CAPL Script to push on key button | G | on key 'G'
{
int a=0x33;
switch(aa){
case (0x32) : write("0x32 is %x",aa); break;
case (0x33) write("0x33 is %x", aa); break;
}
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to push on key button
### Input:
G
### Response:
on key 'G'
{
int a=0x33;
switch(aa){
case (0x32) : write("0x32 is %x",aa); break;
case (0x33) write("0x33 is %x", aa); break;
}
}
|
Create a CAPL Script to calculate the ceiling of a value | 3.2 | void ceil_number
{
float x;
x = _ceil(3.2); // x == 4.0
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to calculate the ceiling of a value
### Input:
3.2
### Response:
void ceil_number
{
float x;
x = _ceil(3.2); // x == 4.0
}
|
Create a CAPL Script to Calculates the floor of a value | 3.6 | void floor_number
{
float x;
x = _floor(3.6); // x == 3.0} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates the floor of a value
### Input:
3.6
### Response:
void floor_number
{
float x;
x = _floor(3.6); // x == 3.0}
|
Create a CAPL Script to Calculates the natural logarithm | 1 | void nature_log_number
{
double x;
x = _log(1.0); // x == 0.0 because Logarithm of x (to base e).
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates the natural logarithm
### Input:
1
### Response:
void nature_log_number
{
double x;
x = _log(1.0); // x == 0.0 because Logarithm of x (to base e).
}
|
Create a CAPL Script to Calculates the logarithm to base 10 | 100 | void log_number
{
double x;
x = _log(100.0); // x == 2.0 because Logarithm of x (to base 10).
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates the logarithm to base 10
### Input:
100
### Response:
void log_number
{
double x;
x = _log(100.0); // x == 2.0 because Logarithm of x (to base 10).
}
|
Create a CAPL Script to Returns the maximum of the parameters | void Return_max
{
float result;
result = _max(1.0, _max(-3.0, 5.2)); // result == 5.2
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the maximum of the parameters
### Input:
### Response:
void Return_max
{
float result;
result = _max(1.0, _max(-3.0, 5.2)); // result == 5.2
}
|
|
Create a CAPL Script to Returns the minimum of the parameters | void Return_min
{
float result;
result = _min(1.0, _min(-3.0, 5.2)); // result == -3.0
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the minimum of the parameters
### Input:
### Response:
void Return_min
{
float result;
result = _min(1.0, _min(-3.0, 5.2)); // result == -3.0
}
|
|
Create a CAPL Script to x to the power of y. | void Return_pow
{
double result;
result = _pow(2.0, 3.0); // result == 8.0
result = _pow(4.0, 0.5); // result == 2.0
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to x to the power of y.
### Input:
### Response:
void Return_pow
{
double result;
result = _pow(2.0, 3.0); // result == 8.0
result = _pow(4.0, 0.5); // result == 2.0
}
|
|
Create a CAPL Script to Rounds x to the nearest integral number | void Return_Round
{
long result;
result = _round(2.4); // result == 2
result = _round(2.5); // result == 3
result = _round(-3.5); // result == -4
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Rounds x to the nearest integral number
### Input:
### Response:
void Return_Round
{
long result;
result = _round(2.4); // result == 2
result = _round(2.5); // result == 3
result = _round(-3.5); // result == -4
}
|
|
Create a CAPL Script to Returns the absolute value | void Return_Abs
{
long x;
x = abs(15); // Result: 15
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the absolute value
### Input:
### Response:
void Return_Abs
{
long x;
x = abs(15); // Result: 15
}
|
|
Create a CAPL Script to Calculates the absolute date/time of the measurement start plus an offset | index number
0 : Milliseconds (0 - 999)
1 : Seconds (0 - 59)
2 : Minutes (0 - 59)
3 : Hours (0 - 23)
4 : Day of month (1 - 31)
5 : Month (0 - 11)
6 : Year (0 - xxx, offset of 1900, e.g. 117 = 2017)
7 : Day of week (0 - 6, Sunday is 0) | on errorframe
{
long time[8];
addTimeToMeasurementStartTime(timeNowNS(), time);
write("ErrorFrame occured on %02d/%02d/%02d %02d:%02d:%02d.%-3d",
time[5]+1, time[4], time[6]-100, time[3], time[2], time[1], time[0]);
getMeasurementStartTime(time);
write("Measurement was started on %02d/%02d/%02d %02d:%02d:%02d.%-3d",
time[5]+1, time[4], time[6]-100, time[3], time[2], time[1], time[0]);
}
// Output e.g.:
// ErrorFrame occured on 08/15/17 14:39:46.787
// Measurement was started on 08/15/17 14:39:29.547 |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates the absolute date/time of the measurement start plus an offset
### Input:
index number
0 : Milliseconds (0 - 999)
1 : Seconds (0 - 59)
2 : Minutes (0 - 59)
3 : Hours (0 - 23)
4 : Day of month (1 - 31)
5 : Month (0 - 11)
6 : Year (0 - xxx, offset of 1900, e.g. 117 = 2017)
7 : Day of week (0 - 6, Sunday is 0)
### Response:
on errorframe
{
long time[8];
addTimeToMeasurementStartTime(timeNowNS(), time);
write("ErrorFrame occured on %02d/%02d/%02d %02d:%02d:%02d.%-3d",
time[5]+1, time[4], time[6]-100, time[3], time[2], time[1], time[0]);
getMeasurementStartTime(time);
write("Measurement was started on %02d/%02d/%02d %02d:%02d:%02d.%-3d",
time[5]+1, time[4], time[6]-100, time[3], time[2], time[1], time[0]);
}
// Output e.g.:
// ErrorFrame occured on 08/15/17 14:39:46.787
// Measurement was started on 08/15/17 14:39:29.547
|
Create a CAPL Script to Calculates arccosine of x | void Return_arccos
{
double x;
x = arccos(0); // result PI/2
x = arccos(1); // result 0
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates arccosine of x
### Input:
### Response:
void Return_arccos
{
double x;
x = arccos(0); // result PI/2
x = arccos(1); // result 0
}
|
|
Create a CAPL Script to Calculates arcsine of x | void Return_arcsin
{
double x;
x = arcsin(1); // result PI/2
x = arcsin(0); // result 0
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates arcsine of x
### Input:
### Response:
void Return_arcsin
{
double x;
x = arcsin(1); // result PI/2
x = arcsin(0); // result 0
}
|
|
Create a CAPL Script to Calculates arctangent of x. | void Return_arctan
{
double x;
x = arctan(0); // result 0
x = arctan(1); // result PI/4
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates arctangent of x.
### Input:
### Response:
void Return_arctan
{
double x;
x = arctan(0); // result 0
x = arctan(1); // result PI/4
}
|
|
Create a CAPL Script to The function converts the string s into a double number | void Return_atodbl
{
double d;
d = atodbl(" -3.7"); // -3.7
d = atodbl("0x1F"); // 31.0
d = atodbl("1.3E2"); // 130.0
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to The function converts the string s into a double number
### Input:
### Response:
void Return_atodbl
{
double d;
d = atodbl(" -3.7"); // -3.7
d = atodbl("0x1F"); // 31.0
d = atodbl("1.3E2"); // 130.0
}
|
|
Create a CAPL Script to converts the string s to a LONG number | void Return_atol
{
long z1;
long z2;
z1 = atol("200"); // 200
z2 = atol("0xFF"); // 255
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to converts the string s to a LONG number
### Input:
### Response:
void Return_atol
{
long z1;
long z2;
z1 = atol("200"); // 200
z2 = atol("0xFF"); // 255
}
|
|
Create a CAPL Script to Calls all event procedures for environment variables | on start
{
callAllOnEnvVar();
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calls all event procedures for environment variables
### Input:
### Response:
on start
{
callAllOnEnvVar();
}
|
|
Create a CAPL Script to Stops an active timer | variables {
Timer takt;
message 100 data = {dlc = 1, byte(0) = 0xFF, dir = Tx};
}
on Timer takt{
output(data);
setTimer(takt, 2);
}
on key F1 {
cancelTimer(takt); // cancel timer
write("canceled");
}
on key F2 {
setTimer(takt, 2); // set timer to 2s
write("start");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Stops an active timer
### Input:
### Response:
variables {
Timer takt;
message 100 data = {dlc = 1, byte(0) = 0xFF, dir = Tx};
}
on Timer takt{
output(data);
setTimer(takt, 2);
}
on key F1 {
cancelTimer(takt); // cancel timer
write("canceled");
}
on key F2 {
setTimer(takt, 2); // set timer to 2s
write("start");
}
|
|
Create a CAPL Script to Stops an active mstimer | variables {
msTimer takt;
message 100 data = {dlc = 1, byte(0) = 0xFF, dir = Tx};
}
on Timer takt{
output(data);
setTimer(takt, 200);
}
on key F1 {
cancelTimer(takt); // cancel timer
write("canceled");
}
on key F2 {
setTimer(takt, 200); // set timer to 200ms
write("start");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Stops an active mstimer
### Input:
### Response:
variables {
msTimer takt;
message 100 data = {dlc = 1, byte(0) = 0xFF, dir = Tx};
}
on Timer takt{
output(data);
setTimer(takt, 200);
}
on key F1 {
cancelTimer(takt); // cancel timer
write("canceled");
}
on key F2 {
setTimer(takt, 200); // set timer to 200ms
write("start");
}
|
|
Create a CAPL Script to Cuts the connection between the node and the bus | Flags
1 : Deactivates the CAPL-program
2 : Deactivates the Nodelayer
3 : Deactivates the CAPL-program and the Nodelayer | void canOffline_Practice
{
dword var;
var = canOffline(3); // Deactivates CAPL-Program and Nodelayer-DLL.
canOnline(); // Activates CAPL-Program. Form 1
var = canOnline(2); // Activates Nodelayer-DLL
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Cuts the connection between the node and the bus
### Input:
Flags
1 : Deactivates the CAPL-program
2 : Deactivates the Nodelayer
3 : Deactivates the CAPL-program and the Nodelayer
### Response:
void canOffline_Practice
{
dword var;
var = canOffline(3); // Deactivates CAPL-Program and Nodelayer-DLL.
canOnline(); // Activates CAPL-Program. Form 1
var = canOnline(2); // Activates Nodelayer-DLL
}
|
Create a CAPL Script to Restores the connection of the node to the bus | Flags
1 : Deactivates the CAPL-program
2 : Deactivates the Nodelayer
3 : Deactivates the CAPL-program and the Nodelayer | void canOffline_Practice
{
dword var;
var = canOffline(3); // Deactivates CAPL-Program and Nodelayer-DLL.
canOnline(); // Activates CAPL-Program. Form 1
var = canOnline(2); // Activates Nodelayer-DLL
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Restores the connection of the node to the bus
### Input:
Flags
1 : Deactivates the CAPL-program
2 : Deactivates the Nodelayer
3 : Deactivates the CAPL-program and the Nodelayer
### Response:
void canOffline_Practice
{
dword var;
var = canOffline(3); // Deactivates CAPL-Program and Nodelayer-DLL.
canOnline(); // Activates CAPL-Program. Form 1
var = canOnline(2); // Activates Nodelayer-DLL
}
|
Create a CAPL Script to Indicates completion of pre-stop actions carried out in a certain node after a measurement stop has been deferred by DeferStop | on preStop
{
message ShutdownReq m;
output(m);
DeferStop(1000); // measurement is stopped if ACK has not
// yet been received after one second
}
on message ShutdownAck
{
CompleteStop();
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Indicates completion of pre-stop actions carried out in a certain node after a measurement stop has been deferred by DeferStop
### Input:
### Response:
on preStop
{
message ShutdownReq m;
output(m);
DeferStop(1000); // measurement is stopped if ACK has not
// yet been received after one second
}
on message ShutdownAck
{
CompleteStop();
}
|
|
Create a CAPL Script to Calculates cosine of x | double tangens(double x) {
return sin(x) / cos(x);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates cosine of x
### Input:
### Response:
double tangens(double x) {
return sin(x) / cos(x);
}
|
|
Create a CAPL Script to Sets a marker in CANoe Trace Window, Graphics Window and State Tracker | on key 'a'
// sets a marker by pressing key <a>
{
createGlobalMarker("speed", "speedDesc");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Sets a marker in CANoe Trace Window, Graphics Window and State Tracker
### Input:
### Response:
on key 'a'
// sets a marker by pressing key <a>
{
createGlobalMarker("speed", "speedDesc");
}
|
|
Create a CAPL Script to Decodes the byte array input from the encoding codepage to the current CAPL string encoding. | Return Values
0: Success, the byte array output is valid.
-1: Illegal character (e.g. illegal UTF8 code point).
-2: Insufficient buffer space, output array is too small.
-3: Internal error. | includes
{
#include "Encoding.cin"
}
void decode_script
{
int result;
char text[10];
byte stream[6] = {0xC3, 0xA4, 0xC3, 0xB6, 0xC3, 0xBC};
result = DecodeString(text, 10, stream, 6, CP_UTF8);
// on German Windows, text is now {‘?’, ‘?’, ‘?’, 0}
if (result == 0) {
write(text);
// Output (on a German Windows): ???
}
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Decodes the byte array input from the encoding codepage to the current CAPL string encoding.
### Input:
Return Values
0: Success, the byte array output is valid.
-1: Illegal character (e.g. illegal UTF8 code point).
-2: Insufficient buffer space, output array is too small.
-3: Internal error.
### Response:
includes
{
#include "Encoding.cin"
}
void decode_script
{
int result;
char text[10];
byte stream[6] = {0xC3, 0xA4, 0xC3, 0xB6, 0xC3, 0xBC};
result = DecodeString(text, 10, stream, 6, CP_UTF8);
// on German Windows, text is now {‘?’, ‘?’, ‘?’, 0}
if (result == 0) {
write(text);
// Output (on a German Windows): ???
}
}
|
Create a CAPL Script to Defers measurement stop | on preStop
{
message ShutdownReq m;
output(m);
DeferStop(1000);
}
on message ShutdownAck
{
CompleteStop();
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Defers measurement stop
### Input:
### Response:
on preStop
{
message ShutdownReq m;
output(m);
DeferStop(1000);
}
on message ShutdownAck
{
CompleteStop();
}
|
|
Create a CAPL Script to Determines the number of elements of an array | void bsp(int ar[]) {
int i;
for(i=0; i < elCount(ar); i++)
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Determines the number of elements of an array
### Input:
### Response:
void bsp(int ar[]) {
int i;
for(i=0; i < elCount(ar); i++)
}
|
|
Create a CAPL Script to Encodes the string input with the encoding codepage | Return Values
0: Success, the byte array output and the resulting length encodedSize are valid.
-1: Illegal character (e.g. illegal UTF8 code point).
-2: Insufficient buffer space, output array is too small.
-3: Internal error. | includes
{
#include "Encoding.cin"
}
void encode_script
{
int result;
char text[4] = "???";
byte stream[10];
long len;
result = EncodeString(stream, len, 10, text, CP_UTF8);
// on German Windows, len is now 7, stream is now {0xC3, 0xA4, 0xC3, 0xB6, 0xC3, 0xBC, 0};
if (result == 0) {...}
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Encodes the string input with the encoding codepage
### Input:
Return Values
0: Success, the byte array output and the resulting length encodedSize are valid.
-1: Illegal character (e.g. illegal UTF8 code point).
-2: Insufficient buffer space, output array is too small.
-3: Internal error.
### Response:
includes
{
#include "Encoding.cin"
}
void encode_script
{
int result;
char text[4] = "???";
byte stream[10];
long len;
result = EncodeString(stream, len, 10, text, CP_UTF8);
// on German Windows, len is now 7, stream is now {0xC3, 0xA4, 0xC3, 0xB6, 0xC3, 0xBC, 0};
if (result == 0) {...}
}
|
Create a CAPL Script to Calculates the exponential function | void Return_exp
{
double x;
x = exp(5);
write("Exponent of 5: %f",x); // Result: 148.413159
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Calculates the exponential function
### Input:
### Response:
void Return_exp
{
double x;
x = exp(5);
write("Exponent of 5: %f",x); // Result: 148.413159
}
|
|
Create a CAPL Script to creates an FDX client handle for the FDX client with the specified address | void Return_fdx_tcp_ip4
{
long fdxClientHandle = 0;
dword fdxClientPort = 0;
dword fdxClientAddr = 0;
fdxClientAddr = IpGetAddressAsNumber("127.0.0.1");
fdxClientPort = 2810;
fdxClientHandle = FDXClientHandleTcp(fdxClientAddr, fdxClientPort);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to creates an FDX client handle for the FDX client with the specified address
### Input:
### Response:
void Return_fdx_tcp_ip4
{
long fdxClientHandle = 0;
dword fdxClientPort = 0;
dword fdxClientAddr = 0;
fdxClientAddr = IpGetAddressAsNumber("127.0.0.1");
fdxClientPort = 2810;
fdxClientHandle = FDXClientHandleTcp(fdxClientAddr, fdxClientPort);
}
|
|
Create a CAPL Script to creates an FDX client handle for the FDX client with the specified address | void Return_fdx_udp_ip4
{
long fdxClientHandle = 0;
dword fdxClientPort = 0;
dword fdxClientAddr = 0;
fdxClientAddr = IpGetAddressAsNumber("127.0.0.1");
fdxClientPort = 2810;
fdxClientHandle = FDXClientHandleUdp(fdxClientAddr, fdxClientPort);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to creates an FDX client handle for the FDX client with the specified address
### Input:
### Response:
void Return_fdx_udp_ip4
{
long fdxClientHandle = 0;
dword fdxClientPort = 0;
dword fdxClientAddr = 0;
fdxClientAddr = IpGetAddressAsNumber("127.0.0.1");
fdxClientPort = 2810;
fdxClientHandle = FDXClientHandleUdp(fdxClientAddr, fdxClientPort);
}
|
|
Create a CAPL Script to return in its second parameter the CAN (or CAN-FD) frame, the PDU was contained | Return Values
0: Data access successful.
-1: Wrong bus type; CAN message is not available.
-2: Message does not support this info.
-3: The PDU object is invalid.
-4: PDU is not of Rx type.
-5: Parameter too small (e.g. array has too less bytes)
-6: Message or PDU is not available (any more) | on PDU PDU_A
{
message * aMsg_01;
long result;
result = GetCANMessage(this, aMsg_01); // PDU is assumed to be sent on CAN
if (result == 0)
{
write("Received PDU 'PDU_A' in message with CAN ID %lu", aMsg_01.ID);
}
else
{
write("Error accessing PDU!");
}
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to return in its second parameter the CAN (or CAN-FD) frame, the PDU was contained
### Input:
Return Values
0: Data access successful.
-1: Wrong bus type; CAN message is not available.
-2: Message does not support this info.
-3: The PDU object is invalid.
-4: PDU is not of Rx type.
-5: Parameter too small (e.g. array has too less bytes)
-6: Message or PDU is not available (any more)
### Response:
on PDU PDU_A
{
message * aMsg_01;
long result;
result = GetCANMessage(this, aMsg_01); // PDU is assumed to be sent on CAN
if (result == 0)
{
write("Received PDU 'PDU_A' in message with CAN ID %lu", aMsg_01.ID);
}
else
{
write("Error accessing PDU!");
}
}
|
Create a CAPL Script to Finds out the file name of the first assigned database | Return Values
If successful unequal 0, otherwise 0. | on start
{
char buffer[256];
dword pos;
pos = GetFirstCANdbFilename( buffer, elcount( buffer));
//Finds the file name of the first database.
//If a database is found, "pos" contains the value 1.
//If none is found "pos" contains 0.
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = GetNextCANdbFilename( pos, buffer, elcount( buffer));
//Finds the file names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = GetNextCANdbFilename(DbcNumber, buffer, elcount(buffer));
//Returns the file name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database file name : %s",pos, buffer);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Finds out the file name of the first assigned database
### Input:
Return Values
If successful unequal 0, otherwise 0.
### Response:
on start
{
char buffer[256];
dword pos;
pos = GetFirstCANdbFilename( buffer, elcount( buffer));
//Finds the file name of the first database.
//If a database is found, "pos" contains the value 1.
//If none is found "pos" contains 0.
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = GetNextCANdbFilename( pos, buffer, elcount( buffer));
//Finds the file names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = GetNextCANdbFilename(DbcNumber, buffer, elcount(buffer));
//Returns the file name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database file name : %s",pos, buffer);
}
|
Create a CAPL Script to Finds out the name of the first assigned database | Return Values
If successful unequal 0, otherwise 0. | on start
{
char buffer[256];
dword pos;
pos = GetFirstCANdbName( buffer, elcount( buffer));
//Finds the name of the first database.
//If a database is found, "pos" contains the value 1
//If none is found "pos" contains 0
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = GetNextCANdbName( pos, buffer, elcount( buffer));
//Finds the names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = GetNextCANdbName(DbcNumber, buffer, elcount(buffer));
//Returns the name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database name : %s",pos, buffer);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Finds out the name of the first assigned database
### Input:
Return Values
If successful unequal 0, otherwise 0.
### Response:
on start
{
char buffer[256];
dword pos;
pos = GetFirstCANdbName( buffer, elcount( buffer));
//Finds the name of the first database.
//If a database is found, "pos" contains the value 1
//If none is found "pos" contains 0
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = GetNextCANdbName( pos, buffer, elcount( buffer));
//Finds the names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = GetNextCANdbName(DbcNumber, buffer, elcount(buffer));
//Returns the name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database name : %s",pos, buffer);
}
|
Create a CAPL Script to Gets the value of a message attribute from the database. | Return Values
Value of the attribute (or default value) from the database | on message *
{
long cycleTimeValue1;
long cycleTimeValue2;
cycleTimeValue1 = getMessageAttrInt(this, "GenMsgCycleTime");
write("CycleTime of message id %x = %d", this.id, cycleTimeValue1);
message EngineData gMsgEngineData;
cycleTimeValue2 = getMessageAttrInt(gMsgEngineData, "GenMsgCycleTime");
write("CycleTime of message id %x = %d", this.id, cycleTimeValue2);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Gets the value of a message attribute from the database.
### Input:
Return Values
Value of the attribute (or default value) from the database
### Response:
on message *
{
long cycleTimeValue1;
long cycleTimeValue2;
cycleTimeValue1 = getMessageAttrInt(this, "GenMsgCycleTime");
write("CycleTime of message id %x = %d", this.id, cycleTimeValue1);
message EngineData gMsgEngineData;
cycleTimeValue2 = getMessageAttrInt(gMsgEngineData, "GenMsgCycleTime");
write("CycleTime of message id %x = %d", this.id, cycleTimeValue2);
}
|
Create a CAPL Script to Finds out the message ID | Return Values
Message ID, or (dword)-1 if the message is not found | void Return_GetMessageID
{
dword id;
id = GetMessageID("LightState");} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Finds out the message ID
### Input:
Return Values
Message ID, or (dword)-1 if the message is not found
### Response:
void Return_GetMessageID
{
dword id;
id = GetMessageID("LightState");}
|
Create a CAPL Script to Finds out the message name. | Available bus types:
CAN : 1
LIN : 5
MOST : 6
FlexRay : 7
J1708 : 9 | variables
{
dword contextCAN = 0x00010000;
dword contextLIN = 0x00050000;
dword contextMOST = 0x00060000;
dword contextFLEXRAY = 0x00070000;
dword contextBEAN = 0x00080000;
dword contextJ1708 = 0x00090000;
}
on message *
{
char buffer[64];
if ( getMessageName( this.ID, contextCAN | this.CAN, buffer, elcount( buffer)))
{
write( "Message: %s", buffer);
}
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Finds out the message name.
### Input:
Available bus types:
CAN : 1
LIN : 5
MOST : 6
FlexRay : 7
J1708 : 9
### Response:
variables
{
dword contextCAN = 0x00010000;
dword contextLIN = 0x00050000;
dword contextMOST = 0x00060000;
dword contextFLEXRAY = 0x00070000;
dword contextBEAN = 0x00080000;
dword contextJ1708 = 0x00090000;
}
on message *
{
char buffer[64];
if ( getMessageName( this.ID, contextCAN | this.CAN, buffer, elcount( buffer)))
{
write( "Message: %s", buffer);
}
}
|
Create a CAPL Script to Finds out the file names of the other assigned databases with pos. | Return Values
If successful unequal 0, otherwise 0. | on start
{
char buffer[256];
dword pos;
pos = getFirstCANdbFilename( buffer, elcount( buffer));
//Finds the file name of the first database.
//If a database is found, "pos" contains the value 1.
//If none is found "pos" contains 0.
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = getNextCANdbFilename( pos, buffer, elcount( buffer));
//Finds the file names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = getNextCANdbFilename(DbcNumber, buffer, elcount(buffer));
//Returns the file name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database file name : %s",pos, buffer);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Finds out the file names of the other assigned databases with pos.
### Input:
Return Values
If successful unequal 0, otherwise 0.
### Response:
on start
{
char buffer[256];
dword pos;
pos = getFirstCANdbFilename( buffer, elcount( buffer));
//Finds the file name of the first database.
//If a database is found, "pos" contains the value 1.
//If none is found "pos" contains 0.
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = getNextCANdbFilename( pos, buffer, elcount( buffer));
//Finds the file names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = getNextCANdbFilename(DbcNumber, buffer, elcount(buffer));
//Returns the file name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database file name : %s",pos, buffer);
}
|
Create a CAPL Script to Finds out the names of the other assigned databases with pos. | Return Values
If successful unequal 0, otherwise 0. | on start
{
char buffer[256];
dword pos;
pos = getFirstCANdbName( buffer, elcount( buffer));
//Finds the name of the first database.
//If a database is found, "pos" contains the value 1.
//If none is found "pos" contains 0.
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = getNextCANdbName( pos, buffer, elcount( buffer));
//Finds the names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = getNextCANdbName(DbcNumber, buffer, elcount(buffer));
//Returns the name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database name : %s",pos, buffer);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Finds out the names of the other assigned databases with pos.
### Input:
Return Values
If successful unequal 0, otherwise 0.
### Response:
on start
{
char buffer[256];
dword pos;
pos = getFirstCANdbName( buffer, elcount( buffer));
//Finds the name of the first database.
//If a database is found, "pos" contains the value 1.
//If none is found "pos" contains 0.
while ( 0 != pos)
{
write( "CANdb: %s", buffer);
pos = getNextCANdbName( pos, buffer, elcount( buffer));
//Finds the names of other databases.
//If any other databases are found
//"pos" contains the value 2, 3, etc
//If no further databases are found
//"pos" contains 0 and the loop is exited
}
}
Example to find the third database
on key '3'
{
char buffer[256];
dword pos;
dword DbcNumber = 2; //Position number of the second database
pos = getNextCANdbName(DbcNumber, buffer, elcount(buffer));
//Returns the name of the third database.
//Return value "pos" contains the value 3.
//If no third database is found "pos" contains 0.
write( "Database position number : %d Database name : %s",pos, buffer);
}
|
Create a CAPL Script to Outputs a message from the program block | variables {
message can2.125 msg = { // define CAN message
dlc = 1,
byte(0) = 1
};
}
on key F1 {
output (msg); // output Message
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Outputs a message from the program block
### Input:
### Response:
variables {
message can2.125 msg = { // define CAN message
dlc = 1,
byte(0) = 1
};
}
on key F1 {
output (msg); // output Message
}
|
|
Create a CAPL Script to Outputs an Error Frame from the program block | Parameters
msg : Variable of type message.
errorFrame : Variable of type errorFrame. | on key F10 {
output(errorFrame); // output Error Frame on CAN channel 1
}
on CAN2.errorFrame {
output (CAN3.errorFrame); // output Error Frame on CAN channel 3
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Outputs an Error Frame from the program block
### Input:
Parameters
msg : Variable of type message.
errorFrame : Variable of type errorFrame.
### Response:
on key F10 {
output(errorFrame); // output Error Frame on CAN channel 1
}
on CAN2.errorFrame {
output (CAN3.errorFrame); // output Error Frame on CAN channel 3
}
|
Create a CAPL Script to Returns the number of CAN overload frames on channel x since start of measurement. | Return Values
Number of CAN overload frames on channel x since start of measurement. | void Return_CAN_Overload_Frame_Count
{
write ("Number of overload frames on CAN1 = %d", CAN1.OverloadFrameCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the number of CAN overload frames on channel x since start of measurement.
### Input:
Return Values
Number of CAN overload frames on channel x since start of measurement.
### Response:
void Return_CAN_Overload_Frame_Count
{
write ("Number of overload frames on CAN1 = %d", CAN1.OverloadFrameCount);
}
|
Create a CAPL Script to Returns the current rate of CAN overload frames on channel x. | Return Values
Current rate of CAN overload frames on channel x in messages per second. | void Return_CAN_Overload_Frame_Rate
{
write ("Rate of overload frames on CAN1 = %d", CAN1.OverloadFrameRate);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current rate of CAN overload frames on channel x.
### Input:
Return Values
Current rate of CAN overload frames on channel x in messages per second.
### Response:
void Return_CAN_Overload_Frame_Rate
{
write ("Rate of overload frames on CAN1 = %d", CAN1.OverloadFrameRate);
}
|
Create a CAPL Script to Resets the CAN controller. | on key 'r' { // Controller is reset after BUSOFF
resetCan();
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Resets the CAN controller.
### Input:
### Response:
on key 'r' { // Controller is reset after BUSOFF
resetCan();
}
|
|
Create a CAPL Script to Resets the CAN controller for one specific CAN channel | on key 'r' { // After BUSOFF the controller on Channel 2 is reset
resetCanEx(2);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Resets the CAN controller for one specific CAN channel
### Input:
### Response:
on key 'r' { // After BUSOFF the controller on Channel 2 is reset
resetCanEx(2);
}
|
|
Create a CAPL Script to Returns the peakload of channel x. | Return Values
Peakload of channel x in percent. | on key 'r' {
write ("CAN1 peakload = %d", CAN1.PeakLoad);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the peakload of channel x.
### Input:
Return Values
Peakload of channel x in percent.
### Response:
on key 'r' {
write ("CAN1 peakload = %d", CAN1.PeakLoad);
}
|
Create a CAPL Script to Returns the current Rx error count in the receiver of channel x. | Return Values
Current error count in the receiver of channel x. | on key 'r' {
write ("Rx error count in the receiver of CAN1 = %d", CAN1.RxChipErrorCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current Rx error count in the receiver of channel x.
### Input:
Return Values
Current error count in the receiver of channel x.
### Response:
on key 'r' {
write ("Rx error count in the receiver of CAN1 = %d", CAN1.RxChipErrorCount);
}
|
Create a CAPL Script to Sets another baud rate. The values do not become active until the next call of the function resetCan. | Return Values
Always 1 | on key 'r' {
setBtr(0, 0x00, 0x3a); // 500 kBaud for 82C200
resetCan(); // activate
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Sets another baud rate. The values do not become active until the next call of the function resetCan.
### Input:
Return Values
Always 1
### Response:
on key 'r' {
setBtr(0, 0x00, 0x3a); // 500 kBaud for 82C200
resetCan(); // activate
}
|
Create a CAPL Script to Sets the Output Control Register | Return Values
1: success
0: error | on key 'r' {
setOcr(0, 0x02); // set
resetCan(); // activate
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Sets the Output Control Register
### Input:
Return Values
1: success
0: error
### Response:
on key 'r' {
setOcr(0, 0x02); // set
resetCan(); // activate
}
|
Create a CAPL Script to Returns the number of standard CAN messages on channel x since start of measurement. | Return Values
Number of standard CAN messages on channel x since start of measurement. | on key 'r' {
write ("Number of standard frames on CAN1 = %d", CAN1.StandardFrameCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the number of standard CAN messages on channel x since start of measurement.
### Input:
Return Values
Number of standard CAN messages on channel x since start of measurement.
### Response:
on key 'r' {
write ("Number of standard frames on CAN1 = %d", CAN1.StandardFrameCount);
}
|
Create a CAPL Script to Returns the current rate of standard CAN messages on channel x. | Return Values
Current rate of standard CAN frames on channel x in messages per second. | on key 'r' {
write ("Rate of standard frames on CAN1 = %d", CAN1.StandardFrameRate);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current rate of standard CAN messages on channel x.
### Input:
Return Values
Current rate of standard CAN frames on channel x in messages per second.
### Response:
on key 'r' {
write ("Rate of standard frames on CAN1 = %d", CAN1.StandardFrameRate);
}
|
Create a CAPL Script to Returns the number of standard remote CAN frames on channel x since start of measurement. | Return Values
Number of standard remote CAN frames on channel x since start of measurement. | on key 'r' {
write ("Number of standard remote frames on CAN1 = %d", CAN1.StandardRemoteFrameCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the number of standard remote CAN frames on channel x since start of measurement.
### Input:
Return Values
Number of standard remote CAN frames on channel x since start of measurement.
### Response:
on key 'r' {
write ("Number of standard remote frames on CAN1 = %d", CAN1.StandardRemoteFrameCount);
}
|
Create a CAPL Script to Returns the current rate of standard remote CAN frames of channel x. | Return Values
Current rate of standard remote CAN frames of channel x in messages per second. | on key 'r' {
write ("Rate of standard remote frames of CAN1 = %d", CAN1.StandardRemoteFrameRate);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current rate of standard remote CAN frames of channel x.
### Input:
Return Values
Current rate of standard remote CAN frames of channel x in messages per second.
### Response:
on key 'r' {
write ("Rate of standard remote frames of CAN1 = %d", CAN1.StandardRemoteFrameRate);
}
|
Create a CAPL Script to Returns the current number of Tx errors in the CAN receiver of channel x. | Return Values
Current number of errors in the CAN receiver of channel x. | on key 'r' {
write ("Number of Tx errors in receiver of CAN1 = %d", CAN1.TxChipErrorCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current number of Tx errors in the CAN receiver of channel x.
### Input:
Return Values
Current number of errors in the CAN receiver of channel x.
### Response:
on key 'r' {
write ("Number of Tx errors in receiver of CAN1 = %d", CAN1.TxChipErrorCount);
}
|
Create a CAPL Script to Returns the value of a message identifier independent of its type. | Return Values
Identifier as long value. | on message *
{
long x;
x = valOfId(this);
write("Received Identifier: %d",x);
output(this);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the value of a message identifier independent of its type.
### Input:
Return Values
Identifier as long value.
### Response:
on message *
{
long x;
x = valOfId(this);
write("Received Identifier: %d",x);
output(this);
}
|
Create a CAPL Script to Returns the current busload of channel x. | Return Values
Current busload of channel x in percent. | on key 'r' {
write ("CAN1 busload = %d", CAN1.BusLoad);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current busload of channel x.
### Input:
Return Values
Current busload of channel x in percent.
### Response:
on key 'r' {
write ("CAN1 busload = %d", CAN1.BusLoad);
}
|
Create a CAPL Script to Activates/deactivates the transmit self ack feature in CANoe for the defined channel | channel :CAN channel
activate
0 = deactivate
1 = activate
Return Values
0 = device does not support self ack
1 = successful
-1 = In case of error | on key a'
{
int channel
int activate;
// Activate TX Self-ACK for CAN channel 1
channel = 1;
activate = 1;
canActivateTXSelfAck(channel, activate);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Activates/deactivates the transmit self ack feature in CANoe for the defined channel
### Input:
channel :CAN channel
activate
0 = deactivate
1 = activate
Return Values
0 = device does not support self ack
1 = successful
-1 = In case of error
### Response:
on key a'
{
int channel
int activate;
// Activate TX Self-ACK for CAN channel 1
channel = 1;
activate = 1;
canActivateTXSelfAck(channel, activate);
}
|
Create a CAPL Script to Uses the defined ID of a message to set the bus state to BusOff. | Channel : The CAN channel.
canId : Message ID that is used to set the bus state to BusOff.
Flags
0 = Switches off the disturbance
1 = Switches on the disturbance
Return Values
1 = The disturbance for the defined ID was switched on successfully.
0 = The disturbance for the defined ID could not switched on. | variables
{
message 0x1 msg; // define CAN message
}
on key '1'
{
canConfigureBusOff(msg.msgChannel, msg.Id, 1); // enable disturbance
}
on key '2'
{
output(msg);
}
on key '3'
{
canConfigureBusOff(msg.msgChannel, msg.Id, 0); // disable disturbance
}
on key 'r'
{
resetCanEx(1);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Uses the defined ID of a message to set the bus state to BusOff.
### Input:
Channel : The CAN channel.
canId : Message ID that is used to set the bus state to BusOff.
Flags
0 = Switches off the disturbance
1 = Switches on the disturbance
Return Values
1 = The disturbance for the defined ID was switched on successfully.
0 = The disturbance for the defined ID could not switched on.
### Response:
variables
{
message 0x1 msg; // define CAN message
}
on key '1'
{
canConfigureBusOff(msg.msgChannel, msg.Id, 1); // enable disturbance
}
on key '2'
{
output(msg);
}
on key '3'
{
canConfigureBusOff(msg.msgChannel, msg.Id, 0); // disable disturbance
}
on key 'r'
{
resetCanEx(1);
}
|
Create a CAPL Script to Outputs an Error Frame to the CAN bus. The number of dominant bits and the number of trailing recessive bits are given as arguments. | errorFrame : Variable of type errorFrame.
Dominant : Number of dominant bits.
Recessive :Number of recessive bits.
Return Values
1: OK
0: error, e.g. not supported by driver | on key a'
{
canOutputErrorFrame(errorFrame, 12, 0); //output Error Frame with 12 dominant bits on CAN1
canOutputErrorFrame(CAN2.errorFrame, 6, 0); //output Error Frame with 6 dominant bits on CAN2
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Outputs an Error Frame to the CAN bus. The number of dominant bits and the number of trailing recessive bits are given as arguments.
### Input:
errorFrame : Variable of type errorFrame.
Dominant : Number of dominant bits.
Recessive :Number of recessive bits.
Return Values
1: OK
0: error, e.g. not supported by driver
### Response:
on key a'
{
canOutputErrorFrame(errorFrame, 12, 0); //output Error Frame with 12 dominant bits on CAN1
canOutputErrorFrame(CAN2.errorFrame, 6, 0); //output Error Frame with 6 dominant bits on CAN2
}
|
Create a CAPL Script to Resets CAN channel statistics. | channel : CAN channel (1-based) | on key 'r'
{
// reset statistics on CAN 1
canResetStatistics(1);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Resets CAN channel statistics.
### Input:
channel : CAN channel (1-based)
### Response:
on key 'r'
{
// reset statistics on CAN 1
canResetStatistics(1);
}
|
Create a CAPL Script to Via an acceptance filter the CAN controllers control which received messages are sent through to CANoe | Return Values
0: ok
!=0: error | on key 'a'
{
/*
To distinguish whether the filter is for standard or extended identifier. For extended identifiers the MSB of the code and mask are set.
Description:
Different ports may have different filters for a channel. If the CAN hardware cannot implement the filter, the driver virtualises filtering.
Accept if ((id ^ code) & mask) == 0).
*/
long channel =2;
dword code=0x10;
dword mask=0x10;
canSetChannelAcc(channel,code,mask);
write("channel mask set");
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Via an acceptance filter the CAN controllers control which received messages are sent through to CANoe
### Input:
Return Values
0: ok
!=0: error
### Response:
on key 'a'
{
/*
To distinguish whether the filter is for standard or extended identifier. For extended identifiers the MSB of the code and mask are set.
Description:
Different ports may have different filters for a channel. If the CAN hardware cannot implement the filter, the driver virtualises filtering.
Accept if ((id ^ code) & mask) == 0).
*/
long channel =2;
dword code=0x10;
dword mask=0x10;
canSetChannelAcc(channel,code,mask);
write("channel mask set");
}
|
Create a CAPL Script to Activates/deactivates the TXRQ and Tx of the CAN controller. This function does nothing with the Ack bit. | gtx
0 : tx off
1 : tx on
gtxreq
0 : gtxreq off
1 : gtxreq on
Return Values
0: ok
!=0: error | on key 't'
{
long channel =2;
char gtx =1;
char gtxreq =1;
canSetChannelMode(channel,gtx,gtxreq);
Write("Mode set to tx=%d, txreq=%d",gtx,gtxreq);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Activates/deactivates the TXRQ and Tx of the CAN controller. This function does nothing with the Ack bit.
### Input:
gtx
0 : tx off
1 : tx on
gtxreq
0 : gtxreq off
1 : gtxreq on
Return Values
0: ok
!=0: error
### Response:
on key 't'
{
long channel =2;
char gtx =1;
char gtxreq =1;
canSetChannelMode(channel,gtx,gtxreq);
Write("Mode set to tx=%d, txreq=%d",gtx,gtxreq);
}
|
Create a CAPL Script to Defines the response of the CAN controller to the bus traffic and sets the ACK bit | silent
0 : silent
1 : normal
Return Values
0: ok
!=0: error | on key 's'
{
long channel =2;
long silent =0;
canSetChannelOutput(channel,silent);
Write("silent set to %d",silent);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Defines the response of the CAN controller to the bus traffic and sets the ACK bit
### Input:
silent
0 : silent
1 : normal
Return Values
0: ok
!=0: error
### Response:
on key 's'
{
long channel =2;
long silent =0;
canSetChannelOutput(channel,silent);
Write("silent set to %d",silent);
}
|
Create a CAPL Script to The CAN controller parameters can be set or read. | Return Values
1 = success
0 = error | int ret;
int channel = 1;
canSettings settings;
settings.baudrate = 1000000;
settings.tseg1=5;
settings.tseg2=2;
settings.sjw=2;
settings.sam=1;
settings.flags = 0;
write("Set 1 MB");
ret = canSetConfiguration(channel, settings);
ret = canGetConfiguration(channel, settings);
if (ret)
{
write("Settings: baud= %f, tseg1 = %d, tseg2= %d, sjw = %d, sam = %d, flags = 0x%x",
settings.baudrate, settings.tseg1, settings.tseg2, settings.sjw, settings.sam, settings.flags);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to The CAN controller parameters can be set or read.
### Input:
Return Values
1 = success
0 = error
### Response:
int ret;
int channel = 1;
canSettings settings;
settings.baudrate = 1000000;
settings.tseg1=5;
settings.tseg2=2;
settings.sjw=2;
settings.sam=1;
settings.flags = 0;
write("Set 1 MB");
ret = canSetConfiguration(channel, settings);
ret = canGetConfiguration(channel, settings);
if (ret)
{
write("Settings: baud= %f, tseg1 = %d, tseg2= %d, sjw = %d, sam = %d, flags = 0x%x",
settings.baudrate, settings.tseg1, settings.tseg2, settings.sjw, settings.sam, settings.flags);
}
|
Create a CAPL Script to Returns the current chip state of the CAN x controller. | Return Values
Chip state of the CAN x controller. See the following table for a description of the return values.
0 : Value not available
1 : Simulated
2 : Not used
3 : Error Active
4 : Warning Level
5 : Error Passive
6 : Bus Off | on key 's'
{
write ("Chip state of CAN1 = %d", CAN1.ChipState);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current chip state of the CAN x controller.
### Input:
Return Values
Chip state of the CAN x controller. See the following table for a description of the return values.
0 : Value not available
1 : Simulated
2 : Not used
3 : Error Active
4 : Warning Level
5 : Error Passive
6 : Bus Off
### Response:
on key 's'
{
write ("Chip state of CAN1 = %d", CAN1.ChipState);
}
|
Create a CAPL Script to Returns the number of Error Frames on channel x since start of measurement. | Return Values : Number of Error Frames on channel x since start of measurement. | on key 's'
{
write ("Number of error frames on CAN1 = %d", CAN1.ErrorFrameCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the number of Error Frames on channel x since start of measurement.
### Input:
Return Values : Number of Error Frames on channel x since start of measurement.
### Response:
on key 's'
{
write ("Number of error frames on CAN1 = %d", CAN1.ErrorFrameCount);
}
|
Create a CAPL Script to Returns the current rate of CAN error messages of channel x. | Return Values :
Current rate of CAN error messages on channel x in messages per second. | on key 's'
{
write ("Rate of error messages on CAN1 = %d", CAN1.ErrorFrameRate);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current rate of CAN error messages of channel x.
### Input:
Return Values :
Current rate of CAN error messages on channel x in messages per second.
### Response:
on key 's'
{
write ("Rate of error messages on CAN1 = %d", CAN1.ErrorFrameRate);
}
|
Create a CAPL Script to Returns the number of extended CAN messages on channel x since start of measurement. | Return Values :
Number of extended CAN messages on channel x since start of measurement | on key 's'
{
write ("Number of extended frames on CAN1 = %d", CAN1.ExtendedFrameCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the number of extended CAN messages on channel x since start of measurement.
### Input:
Return Values :
Number of extended CAN messages on channel x since start of measurement
### Response:
on key 's'
{
write ("Number of extended frames on CAN1 = %d", CAN1.ExtendedFrameCount);
}
|
Create a CAPL Script to Returns the current rate of extended CAN messages on channel x. | Return Values :
Current rate of extended CAN messages on channel x in messages per second. | on key 's'
{
write ("Rate of extended frames on CAN1 = %d", CAN1.ExtendedFrameRate);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current rate of extended CAN messages on channel x.
### Input:
Return Values :
Current rate of extended CAN messages on channel x in messages per second.
### Response:
on key 's'
{
write ("Rate of extended frames on CAN1 = %d", CAN1.ExtendedFrameRate);
}
|
Create a CAPL Script to Returns the number of extended remote CAN messages on channel x since start of measurement. | Return Values :
Number of extended remote CAN messages on channel x since start of measurement. | on key 's'
{
write ("Number of extended remote messages on CAN1 = %d", CAN1.ExtendedRemoteFrameCount);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the number of extended remote CAN messages on channel x since start of measurement.
### Input:
Return Values :
Number of extended remote CAN messages on channel x since start of measurement.
### Response:
on key 's'
{
write ("Number of extended remote messages on CAN1 = %d", CAN1.ExtendedRemoteFrameCount);
}
|
Create a CAPL Script to Returns the current rate of extended remote CAN messages on channel x. | Return Values :
Current rate of extended remote CAN messages on channel x in frames per second. | on key 's'
{
write ("Rate of extended remote messages on CAN1 = %d", CAN1.ExtendedRemoteFrameRate);
} |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Create a CAPL Script to Returns the current rate of extended remote CAN messages on channel x.
### Input:
Return Values :
Current rate of extended remote CAN messages on channel x in frames per second.
### Response:
on key 's'
{
write ("Rate of extended remote messages on CAN1 = %d", CAN1.ExtendedRemoteFrameRate);
}
|
README.md exists but content is empty.
- Downloads last month
- 14