0

I'm calling a CAPL function from a C# function and I'm expected to get in C# the value that the CAPL function returns but it always return the same value that has nothing to do with the one I'm assigning inside the CAPL function. Is there something I need to add in my CAPL function so it can pass the correct value to the C# function I'm calling it from? This is how I'm calling the CAPL function from C# and assigning the return value to a variable:

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

This is the way the CAPL function looks:

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);
}

1 Answers1

0

I'm not exactly sure what you are doing, but to call the CAPL function from .NET you need to call the function directly via CaplFunctions.MyCaplFile.MyFunction(param); The rest depends on your setup. If you are using vTESTstudio you just need to export the function with the export keyword. If you are using the old .NET test feature set, you need to reference the CAPL file in your test node. If you are using Visual Studio you might need to reference the generated type library too.

PiranhA
  • 164
  • 1
  • 6