Skip to content

Commit a4cc576

Browse files
committed
add more out para
1 parent 063ab3b commit a4cc576

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

src/S7CommPlusDriver/S7CommPlusConnectionHighLevel.cs

+26-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using System;
1717
using System.Collections.Generic;
1818
using System.Linq;
19-
using System.Text;
2019

2120
namespace S7CommPlusDriver
2221
{
@@ -200,7 +199,7 @@ public int BrowseAllBlocks(out List<BlockInfo> exploreData)
200199
return 0;
201200
}
202201

203-
public int GetBlockXml(uint relid, out string xml_linecomment, out Dictionary<uint, string> xml_comment, out string interfaceDescription, out string[] blockBody, out string fuctionalObjectCode, out string[] intRef, out string[] extRef)
202+
public int GetBlockXml(uint relid, out string blockName, out ProgrammingLanguage lang, out uint blockNumber, out string xml_linecomment, out Dictionary<uint, string> xml_comment, out string interfaceDescription, out string[] blockBody, out string fuctionalObjectCode, out string[] intRef, out string[] extRef)
204203
{
205204
int res;
206205
// With requesting DataInterface_InterfaceDescription, whe would be able to get all informations like the access ids and
@@ -213,14 +212,21 @@ public int GetBlockXml(uint relid, out string xml_linecomment, out Dictionary<ui
213212
fuctionalObjectCode = String.Empty;
214213
intRef = new string[0];
215214
extRef = new string[0];
215+
blockName = null;
216+
lang = ProgrammingLanguage.Undef;
217+
blockNumber = relid & 0xffff;
216218

217219
var exploreReq = new ExploreRequest(ProtocolVersion.V2);
218220
exploreReq.ExploreId = relid;
219221
exploreReq.ExploreRequestId = Ids.None;
220222
exploreReq.ExploreChildsRecursive = 1;
221-
exploreReq.ExploreParents = 0;
223+
exploreReq.ExploreParents = 0;
224+
225+
// We want to know the following attributes
226+
exploreReq.AddressList.Add(Ids.ObjectVariableTypeName);
227+
//exploreReq.AddressList.Add(Ids.Block_BlockNumber);
228+
exploreReq.AddressList.Add(Ids.Block_BlockLanguage);
222229

223-
// We want to know the following attributes
224230
exploreReq.AddressList.Add(Ids.ASObjectES_Comment);
225231
exploreReq.AddressList.Add(Ids.DataInterface_LineComments);
226232
exploreReq.AddressList.Add(Ids.DataInterface_InterfaceDescription);
@@ -252,7 +258,22 @@ public int GetBlockXml(uint relid, out string xml_linecomment, out Dictionary<ui
252258
foreach (var att in obj.Attributes)
253259
{
254260
switch (att.Key)
255-
{
261+
{
262+
case Ids.ObjectVariableTypeName:
263+
{
264+
blockName = ((ValueWString)att.Value).GetValue();
265+
break;
266+
}
267+
case Ids.Block_BlockNumber:
268+
{
269+
break;
270+
}
271+
case Ids.Block_BlockLanguage:
272+
{
273+
var l = ((ValueUInt)att.Value).GetValue();
274+
lang = (ProgrammingLanguage)l;
275+
break;
276+
}
256277
case Ids.FunctionalObject_extRefData:
257278
{
258279
var xx = (ValueBlobSparseArray)att.Value;

0 commit comments

Comments
 (0)