【发布时间】:2015-08-09 02:08:22
【问题描述】:
我一直在编写一个 CAPL 脚本,该脚本会在一定延迟后在每个频道(2 个否)上发送消息。我想使用 SetTimer() 和 mstimer::isRunning 函数生成以下延迟。 我可以使用 setTimer 函数,但我不知道如何使用 mstimer::isRunning。 代码如下:
Variables{
message * temp = {DLC=8};
mstimer timer1;
}
on timer timer1{
//Do nothing
}
onstart{
for(noofChannel=1;noofChannel<=2;noofChannel++){
settimer(timer1,100);
temp.CAN = noofChannel;
temp.ID = 0xAA;
While (mstimer::isrunning)==0 // I need to write this right.
{ //wait for timer to expire}
Output(temp);
}
【问题讨论】:
-
在询问有关 CAPL 的内容时,指定您处于“模拟”还是“测试”模式很重要。根据您编写的脚本类型,可以使用/禁用某些功能。
-
感谢您的建议!我使用的是模拟模式,但我需要一个兼容模拟和实时的解决方案。