0

I have tried the following code.

int CAPLEXPORT far CAPLPASCAL capl_visa_init(double arg)
{    
    return visa_init(arg);
}

CAPL_DLL_INFO CAPL_DLL_INFO_LIST[] =
{
    {"my_visa_init", (CAPL_FARCALL)capl_visa_init, 'D', 1, "F", "\000"},
    ....
    {0,0}
}; 

For this code, I get 'Parse error'. How can I resolve it? Do I need to include an header file?

Sodankoor
  • 35
  • 7

2 Answers2

0

In order for the CAPL compiler and CAPL browser to recognize the DLL, you must link it to the CAPL program. To do this, you can enter the DLL in the Options dialog in CANoe. In this case, the DLL will be available to all CAPL programs that you have. On the other hand you can enter the DLL in the includes section of a CAPL program using the #pragma library command. In this case, it will only be available to this program.

0

It appears that you are missing three elements here (Function category, Text, Parameter name) as defined in the CAPL DLL export table enter image description here

Functions that have been created can be exported into CAPL code with the aid of a table function (CAPL_DLL_INFO_LIST).

The first row of the table contains version information. This row must be defined in the following manner:

{CDLL_VERSION_NAME, (CAPL_FARCALL)CDLL_VERSION, "", "", CAPL_DLL_CDECL, 0xabcd, CDLL_EXPORT },

Example: Using the Export Table

void CAPLEXPORT far CAPLPASCAL appPut(unsigned long x)
{
  data = x;
}

CAPL_DLL_INFO4 table[] = {
{CDLL_VERSION_NAME, (CAPL_FARCALL)CDLL_VERSION, "", "", CAPL_DLL_CDECL, 0xabcd, CDLL_EXPORT },

  {"dllPut", (CAPL_FARCALL)appPut, "CAPL_DLL","This function will save data from CAPL to DLL memory",'V', 1, "D", "\000", {"x"}},
  {0, 0}
};
CAPLEXPORT CAPL_DLL_INFO4 far * caplDllTable4 = table;
Om Choudhary
  • 492
  • 1
  • 7
  • 27