我有两种类型的文本,主要是想获取connection等于号后面的文本,不需要$后面注释的类型,只需要逗号分隔,分号结束的数据,但是目前有两种文件写法,这一种是没有$后面的注释且读取数据与Connection在同一行如下面所示[Connection Manager]
Object_Name = "Connection Manager Object";
Object_Class_Code = 0x06;
Connection123 = 0x04030002,0x44640405,Param2,,Assem100,Param2,,Assem101,,,36,Assem102,"Exclusive Owner","","20 04 24 6E 2C 64 2C 65";
Connection2 = 0x02030002,0x44640305,Param2,0,,Param2,,Assem101,,,36,Assem102,"Input Only","","20 04 24 6E 2C EE 2C 65";还有一种就是读取数据不与Connction在同一行且有注释Connection Manager]
Object_Name = "Connection Manager Object";
Object_Class_Code = 0x06;
Connection1 =
0x04030002, $ 0-15 = supported transport classes
$ 16 = trigger: cyclic
$ 17 = trigger: change of state
$ 18 = trigger: application
$ 19-23 = trigger: reserved
$ 24 = application type: listen-only
$ 25 = application type: input-only
$ 26 = application type: exclusive-owner
$ 27 = application type: redundant-owner
$ 28-30 = reserved
$ 31 = Direction: Client = 0 / Server = 1
0x44640405, $ 0 = O->T fixed size supported
$ 1 = O->T variable size supported
$ 2 = T->O fixed size supported
$ 3 = T->O variable size supported
$ 4-5 = O->T number of bytes per slot (obsolete)
$ 6-7 = T->O number of bytes per slot (obsolete)
$ 8-10 = O->T Real time transfer format
$ 11 = reserved
$ 12-14 = T->O Real time transfer format
$ 15 = reserved
$ 16 = O->T connection type: NULL
$ 17 = O->T connection type: MULTICAST
$ 18 = O->T connection type: POINT2POINT
$ 19 = O->T connection type: reserved
$ 20 = T->O connection type: NULL
$ 21 = T->O connection type: MULTICAST
$ 22 = T->O connection type: POINT2POINT
$ 23 = T->O connection type: reserved
$ 24 = O->T priority: LOW
$ 25 = O->T priority: HIGH
$ 26 = O->T priority: SCHEDULED
$ 27 = O->T priority: reserved
$ 28 = T->O priority: LOW
$ 29 = T->O priority: HIGH
$ 30 = T->O priority: SCHEDULED
$ 31 = T->O priority: reserved
Param5,Param4,Assem100, $ O->T RPI, size, format
Param5,Param3,Assem101, $ T->O RPI, size, format
,, $ proxy config size, format
,, $ target config size, format
"Connection1", $ Connection Name
"", $ help string
"20 04 2C 64 2C 65"; $ Path
Connection2 =
0x02030002, $ 0-15 = supported transport classes
$ 16 = trigger: cyclic
$ 17 = trigger: change of state
$ 18 = trigger: application
$ 19-23 = trigger: reserved
$ 24 = application type: listen-only
$ 25 = application type: input-only
$ 26 = application type: exclusive-owner
$ 27 = application type: redundant-owner
$ 28-30 = reserved
$ 31 = Direction: Client = 0 / Server = 1
0x44640305, $ 0 = O->T fixed size supported
$ 1 = O->T variable size supported
$ 2 = T->O fixed size supported
$ 3 = T->O variable size supported
$ 4-5 = O->T number of bytes per slot (obsolete)
$ 6-7 = T->O number of bytes per slot (obsolete)
$ 8-10 = O->T Real time transfer format
$ 11 = reserved
$ 12-14 = T->O Real time transfer format
$ 15 = reserved
$ 16 = O->T connection type: NULL
$ 17 = O->T connection type: MULTICAST
$ 18 = O->T connection type: POINT2POINT
$ 19 = O->T connection type: reserved
$ 20 = T->O connection type: NULL
$ 21 = T->O connection type: MULTICAST
$ 22 = T->O connection type: POINT2POINT
$ 23 = T->O connection type: reserved
$ 24 = O->T priority: LOW
$ 25 = O->T priority: HIGH
$ 26 = O->T priority: SCHEDULED
$ 27 = O->T priority: reserved
$ 28 = T->O priority: LOW
$ 29 = T->O priority: HIGH
$ 30 = T->O priority: SCHEDULED
$ 31 = T->O priority: reserved
Param5,0,, $ O->T RPI, size, format
Param5,Param7,Assem1, $ T->O RPI, size, format
,, $ proxy config size, format
,, $ target config size, format
"Tag Connection", $ Connection Name
"", $ help string
"SYMBOL_ANSI"; $ Path
Connection3 =
0x02030002, $ 0-15 = supported transport classes
$ 16 = trigger: cyclic
$ 17 = trigger: change of state
$ 18 = trigger: application
$ 19-23 = trigger: reserved
$ 24 = application type: listen-only
$ 25 = application type: input-only
$ 26 = application type: exclusive-owner
$ 27 = application type: redundant-owner
$ 28-30 = reserved
$ 31 = Direction: Client = 0 / Server = 1
0x44640305, $ 0 = O->T fixed size supported
$ 1 = O->T variable size supported
$ 2 = T->O fixed size supported
$ 3 = T->O variable size supported
$ 4-5 = O->T number of bytes per slot (obsolete)
$ 6-7 = T->O number of bytes per slot (obsolete)
$ 8-10 = O->T Real time transfer format
$ 11 = reserved
$ 12-14 = T->O Real time transfer format
$ 15 = reserved
$ 16 = O->T connection type: NULL
$ 17 = O->T connection type: MULTICAST
$ 18 = O->T connection type: POINT2POINT
$ 19 = O->T connection type: reserved
$ 20 = T->O connection type: NULL
$ 21 = T->O connection type: MULTICAST
$ 22 = T->O connection type: POINT2POINT
$ 23 = T->O connection type: reserved
$ 24 = O->T priority: LOW
$ 25 = O->T priority: HIGH
$ 26 = O->T priority: SCHEDULED
$ 27 = O->T priority: reserved
$ 28 = T->O priority: LOW
$ 29 = T->O priority: HIGH
$ 30 = T->O priority: SCHEDULED
$ 31 = T->O priority: reserved
Param5,0,, $ O->T RPI, size, format
Param5,Param3,Assem101, $ T->O RPI, size, format
,, $ proxy config size, format
,, $ target config size, format
"Connection1_Input Only",$ Connection Name
"", $ help string
"20 04 2C C6 2C 65"; $ Path
Connection4 =
0x01030002, $ 0-15 = supported transport classes
$ 16 = trigger: cyclic
$ 17 = trigger: change of state
$ 18 = trigger: application
$ 19-23 = trigger: reserved
$ 24 = application type: listen-only
$ 25 = application type: input-only
$ 26 = application type: exclusive-owner
$ 27 = application type: redundant-owner
$ 28-30 = reserved
$ 31 = Direction: Client = 0 / Server = 1
0x44240305, $ 0 = O->T fixed size supported
$ 1 = O->T variable size supported
$ 2 = T->O fixed size supported
$ 3 = T->O variable size supported
$ 4-5 = O->T number of bytes per slot (obsolete)
$ 6-7 = T->O number of bytes per slot (obsolete)
$ 8-10 = O->T Real time transfer format
$ 11 = reserved
$ 12-14 = T->O Real time transfer format
$ 15 = reserved
$ 16 = O->T connection type: NULL
$ 17 = O->T connection type: MULTICAST
$ 18 = O->T connection type: POINT2POINT
$ 19 = O->T connection type: reserved
$ 20 = T->O connection type: NULL
$ 21 = T->O connection type: MULTICAST
$ 22 = T->O connection type: POINT2POINT
$ 23 = T->O connection type: reserved
$ 24 = O->T priority: LOW
$ 25 = O->T priority: HIGH
$ 26 = O->T priority: SCHEDULED
$ 27 = O->T priority: reserved
$ 28 = T->O priority: LOW
$ 29 = T->O priority: HIGH
$ 30 = T->O priority: SCHEDULED
$ 31 = T->O priority: reserved
Param5,0,, $ O->T RPI, size, format
Param5,Param3,Assem101, $ T->O RPI, size, format
,, $ proxy config size, format
,, $ target config size, format
"Connection1_Listen Only",$ Connection Name
"", $ help string
"20 04 2C C7 2C 65"; $ Path
如何同时解析每一个连接点的数据
Connection3 = 0x01030002,0x44240305,Param2,0,,Param2,,Assem101,,,,,"Listen Only","","20 04 24 6F 2C ED 2C 65";