Hi, In PLCnext engineer I have experimented with the TCP functies send and recieve in combination with a siemens S7-300. I got it to work (see figure). So I’m trying to do make the same example in c# and later in c++ or vise versa depending on the answer on some of the questions I have.
* When I try to debug the C# code and try to follow the chapter of Remote debugging C# code in the manual, my PLCnext 2152 F won't boot normaly after and the D led stays orange.Insert this line of code:
* After some investigation on how to impliment those functions I got stuck on some things:
* I made a functionblock in visual studio 2017 via the plcnext library.
I got my inspiration with for the code via this link: https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcplistener?view=netframework-4.8
* In other system you can call System.Runtime.InteropServices.Marshal.SizeOf(Your struct), but in the code for the PLCnext this is not possible. Is there a way to see the size of a struct?
* Is there also a way to have a struct as input but is not defined in the C# code?
* So I was wondering if it is possible to convert the struct to a byte array?
Best regards, Arne