I have a CAPL test code that controls the start of CAN signal sending. My goal is to delay the start of the sending process. My idea to do this is via a setTimer() function in combination with isTimerActive().
总的说来,我的法律着眼于:
main() {
CANstart();
function_2();
function_3();
}
CANstart() {
SetTimer(Delay, 5000); //Timer initialization, set to be 5000ms
while (isTimerActive()==1) {
// this while loop avoids that the code is proceding while the settimer exception is being called and executed
}
StartCANTransmitting(); // After this function, jump back to main and proceed with function_2
}
on timer Delay {
// Do nothing, just wait
}
以上方案守则导致当时陷入瘫痪,CANoe没有反应,我结束模拟的唯一途径是通过任务人员。
- Further examination from my side lead to the conclusion that the timer need more time to process and is not executed at all.
- Without the isTimerActive() function, the program code does not wait for the timer to finish and there is no delay at all. Seems like the code runs through without waiting for the exception.
- Seems like CAPL handles loops very bad.
我检查了 st流,以下论坛员额谈到我没有提出任何解决办法的非常相似的问题: