CAPL 访问超过 52 位的整数信号

标签 capl canoe canalyzer

问题是关于 CAPL 信号访问。我们假设代码中有来自某个 PDU 的 64 位无符号整数信号。

尝试将信号值分配给 sysvarqword 变量时,例如:

@sysvar::bar = $foo;

出现警告:

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

在 CANoe 帮助中有关警告 2808 我发现

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.

您知道如何在不丢失数据的情况下分配 64 位无符号整数信号值吗?

最佳答案

在文档中找到解决方案:

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;

关于CAPL 访问超过 52 位的整数信号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66260901/

相关文章:

testing - CAPL Canoe 等待特定的 can 消息

canalyzer - 从命令提示符更改数据库

CAPL #include 相对路径

can-bus - 用于诊断服务的 CAPL 脚本

CAPL 类型定义 bool

c++ - 访问 CANalyzer CAPL 系统时钟

canoe - 为什么我无法通过面板更新 CANoe 上的消息?