You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by micheleBridi March 19, 2024
I'm trying to make the browser of a datablock 42, its structure is this:
But when I try to browse AlarmsTime of type struct[] I get this error:
The dimensions and edges of the array-indexes do not match the typeinformation of the plc. Did you provide a (correct) index?
the code I'm using is this:
`
public async Task PlcProgramBrowse()
{
try
{
var allMyPlcProgramBlocks = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children)).Result;
foreach (var block in allMyPlcProgramBlocks.Where(f => f.Db_number is 42))
await RetrieveInfo(block);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
public async Task RetrieveInfo(ApiPlcProgramData block)
{
try
{
if (block.Has_children ?? false)
{
var items = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children, block)).Result;
block.Children = items;
foreach (var child in block.Children)
child.Parents = GetFather(block);
foreach (var item in items)
{
try
{
switch (item.Datatype)
{
case ApiPlcProgramDataType.Struct:
case ApiPlcProgramDataType.DataBlock:
await RetrieveInfo(item);
break;
default:
Symbolics.Add(item);
Discussed in #74
Originally posted by micheleBridi March 19, 2024
I'm trying to make the browser of a datablock 42, its structure is this:
But when I try to browse AlarmsTime of type struct[] I get this error:
The dimensions and edges of the array-indexes do not match the typeinformation of the plc. Did you provide a (correct) index?
the code I'm using is this:
`
public async Task PlcProgramBrowse()
{
try
{
var allMyPlcProgramBlocks = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children)).Result;
}
public async Task RetrieveInfo(ApiPlcProgramData block)
{
try
{
if (block.Has_children ?? false)
{
var items = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children, block)).Result;
break;
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
public List GetFather(ApiPlcProgramData myPlcProgramDataBlock)
{
var result = new List();
}
`
The text was updated successfully, but these errors were encountered: