【问题标题】:How to access Interactive Generator block (IG) in Vector CANoe CAPL?如何访问 Vector CANoe CAPL 中的交互式生成器模块 (IG)?
【发布时间】:2017-06-07 20:28:33
【问题描述】:

我想访问 CAPL 中的 IG 块,例如激活/停用消息发送,设置信号值。但是我没有找到这种capl函数。

【问题讨论】:

    标签: can-bus capl


    【解决方案1】:

    您需要在 CAPL 中声明您自己的消息,然后您应该使用函数“输出”在 CAN 上发送它。下面的示例以 100 毫秒周期发送 ID 为 0x100 的消息。

    enter code here
    variables
    {
      msTimer timer200ms;
      msTimer timer100ms;
      message 0x100 msg = {
        DLC = 8, 
        byte(0) = 0x00, byte(1) = 0x00, byte(2) = 0x00, byte(3) = 0x00,
        byte(4) = 0x00, byte(5) = 0x00, byte(6) = 0x00, byte(7) = 0x00 
     };
      byte myByte[8];
    }
    
    on timer timer200ms{
      int i=0, j=0;
    
      if(i<7){
        if(j<256){
          myByte[i] = j;
          write("frame %d have been change for %d", i, j);
          j++;
          if(j==255){
            i++;
            j=0;
          }
        }
      }
      else{
       cancelTimer(timer200ms); 
      }
    }
    
    on timer timer100ms{
        msg.byte(0) = myByte[0];
        msg.byte(1) = myByte[1];
        msg.byte(2) = myByte[2];
        msg.byte(3) = myByte[3];
        msg.byte(4) = myByte[4];
        msg.byte(5) = myByte[5];
        msg.byte(6) = myByte[6];
        msg.byte(7) = myByte[7];
        output(msg);
    }
    
    on start{
      setTimerCyclic(timer100ms, 100);
      setTimerCyclic(timer200ms, 100);
    }
    

    【讨论】:

      【解决方案2】:

      你必须在按键上做一些功能,或者连接到面板的功能,IG只是一种更简单的发送消息的方式,但你不能将capl与IG连接,因为它们是不同的节点。

      【讨论】:

        猜你喜欢
        • 2021-05-28
        • 1970-01-01
        • 1970-01-01
        • 2020-06-23
        • 2020-08-22
        • 2016-12-23
        • 2011-05-31
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多