Log Write Output to File in CAPL [closed]

谁说胖子不能爱 提交于 2019-12-11 03:36:40

问题


Is there an easy way to take what I write to the write window and log it to a file? Or do I need to separately create an array of chars manually and open a file to write the char[] to? I would love to be able to write to file using regular expressions at the very least but I'm not finding much helpful info from the docs.


回答1:


Looks like writeToLogEx(char format[], ...) can do what I want but it outputs to a Logging Block in the measurement setup. So I'll have some header and footer data that I don't want as well as CAN traffic if I don't put up a channel block.

Vector's Example:

char timeBuffer[64];
getLocalTimeString(timeBuffer);
writeToLogEx("===> %s",timeBuffer);

Regular Expression Options:

"%ld","%d" decimal display
"%lx","%x" hexadecimal display
"%lX","%X" hexadecimal display (upper case)
"%lu","%u" unsigned display
"%lo","%o" octal display
"%s" display a string
"%g","%lf" floating point display
"%c" display a character
"%%" display %-character
"%I64d" decimal display of a 64 bit value
"%I64x" hexadecimal display of a 64 bit value
"%I64X" hexadecimal display of a 64 bit value (upper case)
"%I64u" unsigned display of a 64 bit value


来源:https://stackoverflow.com/questions/25204029/log-write-output-to-file-in-capl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!