caplcanoecanalyzer

CAPL Accessing integer signal with more than 52 bits


The question is regarding CAPL signal access. Let's assume that in the code there is 64-bit unsigned integer signal from some PDU.

While trying to assign signal value to sysvar or qword variable like:

@sysvar::bar = $foo;

The warning shows up:

CAPL / .NET Accessing integer signal '[...]/foo' with more than 52 bits, possible loss of data!

In CANoe help regarding warning 2808 I've found that

In $ instructions only integer signals with up to 52 bits can be used without data loss, as values are saved and disclosed internally as doubles.

Have you any idea how may I assign 64-bit unsigned integer signal value without data loss?


Solution

  • Found the solution in documentation:

    Due to the data type double, .raw does not return the exact values for signals longer than 52 bit. Please use for these signal lengths .raw64 with the data type int64.

    int64 largeValue;
    largeValue = $Some64bitSignal.raw64;