将输出记录写入CAPL中的文件
是否有一种简单的方法可以将我写的内容写入写窗口并将其记录到文件中?还是我需要分别手动创建一个字符数组并打开一个文件来将char []写入其中?我很希望能够至少使用正则表达式写入文件,但我从文档中找不到很多有用的信息。
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.
看起来像writeToLogEx(char format [],...)可以完成我想要的操作,但它会输出到测量设置中的Logging Block。因此,如果不设置通道块,我将拥有一些我不想要的页眉和页脚数据以及CAN流量。
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的示例:
Vector's Example:
char timeBuffer[64];
getLocalTimeString(timeBuffer);
writeToLogEx("===> %s",timeBuffer);
正则表达式选项:
"%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