Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibNoDave crashing while reading blocks #188

Open
bytecode opened this issue Dec 24, 2022 · 1 comment
Open

LibNoDave crashing while reading blocks #188

bytecode opened this issue Dec 24, 2022 · 1 comment

Comments

@bytecode
Copy link

HI,
im trying to download all DB from cpu , while reading the libnodave crashes and sometimes i get stack overflow exception in PLCListBlocks method , i tried same with snap7 and i can download the blocks , here is the output i got from Snap7:
Cpu Type : 6ES7 410-5HX08-0AB0
+-----------------------------------------------------
| UNIT Connection
+-----------------------------------------------------
| Result : OK
| Execution time : 793 ms
+-----------------------------------------------------
Connected to : 192.168.2.11 (Rack=0, Slot=3)
PDU Requested : 480 bytes
PDU Negotiated : 480 bytes

+-----------------------------------------------------
| List Blocks in AG
+-----------------------------------------------------
| Result : OK
| Execution time : 270 ms
+-----------------------------------------------------
OBCount : 22
FBCount : 106
FCCount : 2667
SFBCount : 28
SFCCount : 72
DBCount : 9647
SDBCount : 55

+-----------------------------------------------------

And here is the output from the Toolbox lib:
threadexit

as you can see during "more data" , the thread crashes.

i tested it on another cpu and the thing i noticed (maybe im wrong) if the Total DB count is on the low side like maybe few hundred's , it works flawlessly
Code:
var connection = new PLCConnection(
new PLCConnectionConfiguration("BackupS7",
LibNodaveConnectionConfigurationType.ObjectSavedConfiguration)
{
ConnectionType = LibNodaveConnectionTypes.ISO_over_TCP,
CpuIP = "192.168.2.11",
CpuRack = 0,
CpuSlot = 3
});
connection.Connect();
var szlDat = connection.PLCGetSZL(0x0111, 1);
if (szlDat.SZLDaten.Length > 0)
{
xy11Dataset xy11Szl = szlDat.SZLDaten[0] as xy11Dataset;
if (xy11Szl != null)
Console.WriteLine("Connected, MLFB: " + xy11Szl.MlfB);
}

var x = connection.PLCGetState();
var existingBlocks = connection.PLCListBlocks(PLCBlockType.DB);

@jogibear9988
Copy link
Member

maybe you can record in wireshark, the download you try.
and also enable debug of libnodave via calling the setdaveDebug method of the connection

       SetDaveDebug(0x1ffff) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants