variables
{
message CAN1.Info1_20msCE_CH Msg;
msTimer Delay_100ms;
float count;
float count1;
}
on start
{
count = 0;
count1 = 0;
setTimer(Delay_100ms,10);
}
on timer Delay_100ms
{
if(@VMM::SimDebug) //触发方波
{
if(count < 30)
{
Msg.ParkBrkReq = 1; //输出信号
count++;
write("count=%f",count);
}
else if(count1<30)
{
Msg.ParkBrkReq = 2; //停止输出信号
count1++;
write("count1=%f",count1);
}
else
{
Msg.ParkBrkReq = 1;
count1 = 0; //计数器清零
count = 0; //计数器清零
cancelTimer(Delay_100ms); //取消定时器
}
setTimer(Delay_100ms,10);
output(Msg);
}
}
生成的信号。