This should be handled via either SysVar or EnvVar.
in Panel, you can assign value to a System variable which can be accessed in CAPL code.
for example,
variables
{
byte xxxxx = 0; //assuming 8 bits data
}
on sysvar sysvar:xxxx // name your system variable
{
xxxxx = @this;
}
on message CAN_0x598
{
if(counterAlive == 15)
{
counterAlive = 0;
}
else
{
counter++;
}
msg1.byte(0) = this.byte(0);
msg1.byte(1) = this.byte(1);
msg1.byte(2) = this.byte(2);
msg1.byte(3) = xxxxx ; // Changing through the Panel
msg1.byte(4) = xxxxx +1; //pay attention on overflow value as it can hold till 255
msg1.byte(5) = this.byte(5);
msg1.byte(6) = counter;
msg1.byte(7) = this.byte(7);
}