0

I want to assign a value to a variable in CANoe by using a lookup table.

If sysvar:test changes to the values 1, 2 or 3, then I want that sysvar::show changes to the values 4, 78 and 33 or other values I assign. How can I do this?

Thanks in advance!

  • Hi, I am reviewing your post. Although a good question, it is always a good idea to add some, to show the community your efforts. – rainer May 12 '20 at 14:36
  • What exactly do you want to know? How to react on a sysvar change, how to change a sysvar, how to use an associative array? – MSpiller May 13 '20 at 18:11

1 Answers1

0

This would be a good place to start

variables
{
  int mapValues[int64];
}

on prestart
{
  mapValues[1] = 4;
  mapValues[2] = 78;
  mapValues[3] = 33;
}

on sysvar test
{
  @sysvar::show = mapValues[@sysvar::test];
}
Shyam
  • 649
  • 1
  • 5
  • 20