Menu
  • HOME
  • TAGS

Is it possible to define a CAPL function returning a text string?

string,syntax,capl

You have to do it as you would do with string-based functions : void ErrorCodeToMsg(char buffer[], int code){ buffer = myListOfCodes[code]; } The value will be stored in the buffer using its reference value. It is not possible to return string in Capl. This is why you can't access String...

CAPL Programming usage of Timer as a delay

can,capl

Instead of mstimer::isrunning use isTimerActive() method. isTimerActive() returns 1 if timers is running and 0 if it is expired. So your code will look like: on start{ for(noofChannel=1;noofChannel<=2;noofChannel++){ settimer(timer1,100); temp.CAN = noofChannel; temp.ID = 0xAA; While (isTimerActive(timer1) == 1) { //wait for timer to expire} } Output(temp); } } But...

Sending commands to CANalyzer CAPL application via socket

sockets,can,capl

It turns out CANalyzer does not (currently) have socket interface (CANoe does). Preferred interfacing method is via COM server (both CANalyzer and CANoe act as CAN server by default). See: https://www.vector.com/portal/medien/vector_cantech/faq/ProgrammingWithCAPL.pdf...