Home > Software engineering >  Can't we include .c files in CAPL script?
Can't we include .c files in CAPL script?

Time:07-07

I'm trying to develope a function using already existing functions in other files in .c file. So I need to include header files in this .c file. And now when this .c file with header file is included in the CAPL script it is not working .

CodePudding user response:

No because CAPL is only a subset of c.

CodePudding user response:

In CANoe (I don't know about CANalyzer), there is the possibility to write "CAPL DLLs" and add them to CANoe.

Such DLLs are written in C (so you can use your already existing functions) and add new functions to the CAPL language. In other words: C-written functions are added to CAPL.

And: CAPL DLLs seem to be the only possibility to add C-written functions to CANoe.

CAPL DLLs are often used to access Windows functions not supported by CAPL (such as access to hardware not supported by CANoe, sound output, printing, displaing graphics on the screen etc.).

However, you cannot "simply" take your C functions and click the button, but you have to write a lot of additional code.

For this reason, it might be easier to convert your C functions to CAPL instead of writing a CAPL DLL unless you need access to functions not supported by CAPL.

  • Related