Attribute monitoring_encoding

概述

添加 pragma Attribute monitoring_encoding 到字符串变量和别名。在监测期间,使用此 pragma 标记的变量的值在 UTF-8 格式中解码。

语法

{attribute 'monitoring_encoding' := 'UTF8'}

示例

在变量声明上方中插入此 pragma Attribute monitoring_encoding

PROGRAM PLC_PRG
VAR
    {attribute 'monitoring.encoding' := 'UTF8'}
    strDat : STRING := 'abc'; 
    attribute 'monitoring_encoding' := 'UTF-8'}	
    strVarUtf8: STRING := UTF8#'你好,世界!ÜüÄäÖö';
    {attribute 'monitoring_encoding' := 'UTF-8'}
    str1: STRING := UTF8#'AÄyyy';		
    {attribute 'monitoring_encoding' := 'UTF-8'}		
    str2: STRING := UTF8#'AÄxxxÜÜÜ';	
		
    strVarUtf8_1: STRING := '你好,世界!ÜüÄäÖö';
    str1_1: STRING := 'AÄyyy';				
    str2_1: STRING := 'AÄxxxÜÜÜ';			
END_VAR