ZQ Liu
ZQ Liu

Reputation: 1

How to access Interactive Generator block (IG) in Vector CANoe CAPL?

I want to access IG block in CAPL,e.g activate/deactivate message sending, set signal value. but I didn't find this kind of capl function.

Upvotes: 0

Views: 15908

Answers (2)

BBart
BBart

Reputation: 94

You need to declare you're own message in CAPL, then you should use function "output" to send it on CAN. Below example send message with ID 0x100 with 100ms cycle.

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);
}

Upvotes: 1

Popovici Sebi
Popovici Sebi

Reputation: 258

You have to make some function on key press or , functions connected to a Panel , the IG is just an easyer way to send messages but you cannot connect the capl with IG because are diferent nodes .

Upvotes: 0

Related Questions