【问题标题】:Return value from CAPL function to C# function从 CAPL 函数返回值到 C# 函数
【发布时间】:2018-03-31 23:11:32
【问题描述】:

我正在从 C# 函数调用 CAPL 函数,我希望在 C# 中获取 CAPL 函数返回的值,但它总是返回与我在内部分配的值无关的相同值CAPL 函数。 我需要在我的 CAPL 函数中添加一些东西,以便它可以将正确的值传递给我从中调用它的 C# 函数吗? 这就是我从 C# 调用 CAPL 函数并将返回值分配给变量的方式:

int var = (int)this.SendRawDiagnosticF.Call(id, bytestosend[0], bytestosend[1], bytestosend[2], bytestosend[3], bytestosend[4], bytestosend[5], bytestosend[6], bytestosend[7]); 

这是 CAPL 函数的外观:

int ReturnRXIDMessage(long ID, long DLC, long a, long b, long c, long d, long e, long f, long g, long h)
{
  long o = 0;
  if (messageID == ID + 0x40)
  {
    o = messageID;
  }
  return (o);
}

【问题讨论】:

    标签: c# capl canoe


    【解决方案1】:

    我不确定你在做什么,但要从 .NET 调用 CAPL 函数,你需要直接通过 CaplFunctions.MyCaplFile.MyFunction(param); 调用该函数 其余的取决于您的设置。如果您使用的是 vTESTstudio,您只需要使用 export 关键字导出函数。 如果您使用的是旧的 .NET 测试功能集,则需要在测试节点中引用 CAPL 文件。如果您使用的是 Visual Studio,您可能还需要引用生成的类型库。

    【讨论】:

      猜你喜欢
      • 2016-08-28
      • 1970-01-01
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 2022-04-29
      • 2016-11-30
      • 2014-12-05
      • 1970-01-01
      相关资源
      最近更新 更多