Ejemplo n.º 1
0
        public static Memory <byte> TranslateToMemory(S7CommSetupDatagram datagram)
        {
            var result = S7HeaderDatagram.TranslateToMemory(datagram.Header);

            S7CommSetupParameterDatagram.TranslateToMemory(datagram.Parameter, result.Slice(datagram.Header.GetHeaderSize()));
            return(result);
        }
Ejemplo n.º 2
0
        public static IMemoryOwner <byte> TranslateToMemory(S7CommSetupDatagram datagram, out int memoryLength)
        {
            var result = S7HeaderDatagram.TranslateToMemory(datagram.Header, out memoryLength);
            var take   = memoryLength - datagram.Header.GetHeaderSize();

            S7CommSetupParameterDatagram.TranslateToMemory(datagram.Parameter, result.Memory.Slice(datagram.Header.GetHeaderSize(), take));
            return(result);
        }