天天做工控,做的很無聊, 嘗試自己寫了博圖文件解析。
西門子的數(shù)據(jù)塊解釋文件長(zhǎng)這樣, 可以用博圖得到。
DATA_BLOCK "hah"
{ DB_Accessible_From_OPC_UA := 'FALSE' ;
S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
NON_RETAIN
STRUCT
"1" : Bool;
"2" : Struct
"3" : Array[0..1] of Struct
"8" : Bool;
END_STRUCT;
"4" : Array[0..1] of Struct
"1" : Bool;
"2" : Bool;
"3" : Bool;
"4" : Array[0..1] of Struct
"5" : Bool;
"6" : Bool;
END_STRUCT;
"7" : Array[0..1] of Struct
"1" : Bool;
END_STRUCT;
END_STRUCT;
END_STRUCT;
"3" : Bool;
END_STRUCT;
BEGIN
END_DATA_BLOCK
下面是轉(zhuǎn)換效果, 感興趣的朋友可以交流。