User Activity

  • Modified a comment on discussion Help on NetToPLCSim

    Hi Thomas, so I took the time. After looking at the code some more.. Here are all the changes I made: IsoToS7online.cs [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern int SendMessage(IntPtr hwnd, [MarshalAs(UnmanagedType.U4)] int Msg, IntPtr wParam, IntPtr lParam); Changed to: [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); public void...

  • Posted a comment on discussion Help on NetToPLCSim

    Hi Thomas, so I took the time. After looking at the code some more.. Here are all the changes I made: IsoToS7online.cs [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern int SendMessage(IntPtr hwnd, [MarshalAs(UnmanagedType.U4)] int Msg, IntPtr wParam, IntPtr lParam); Changed to: [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); public void...

  • Modified a comment on discussion Help on NetToPLCSim

    Hi Thomas, it is probably by chance that this is working.. Check this simple console app: using System; using System.Runtime.InteropServices; namespace ConsoleApp1 { class Program { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public class WndProcMessage { public int pdulength; public byte[] pdu; } static void Main(string[] args) { var msg = new WndProcMessage(); msg.pdu = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; msg.pdulength = 16; int test...

  • Posted a comment on discussion Help on NetToPLCSim

    Hi Thomas, it is probably by chance that this is working.. Check this simple console app: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public class WndProcMessage { public int pdulength; public byte[] pdu; } static void Main(string[] args) { var msg = new WndProcMessage(); msg.pdu = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; msg.pdulength = 16; int test = Marshal.SizeOf(msg); // This always returns 8! Because Size is missing in the StructLayout...

  • Posted a comment on discussion Help on NetToPLCSim

    Hello Thomas, I've been using your application (nettoplcsim-s7o) many times now. It helps me a lot. Thank you very much for this code! Since I would like to give something back.. While running multiple PLCSIMs in a Virtual Box (32-Bit XP) I've noticed that Process Explorer showed Private Bytes increasing rapidly until an "Out of Memory" dialog comes up after some time. So I started to investigate if this is a managed or unmanged Leak using perfmon (In case you do not already know and are interested...

View All

Personal Data

Username:
ajbauer
Joined:
2001-08-09 08:55:01

Projects

Skills

  • No skills entered.

Personal Tools