Exemplo n.º 1
0
        private void AddMessage(ModbusPkt pkt)
        {
            bool success = MB.DeleteMessage(pkt.Value);

            MB.SetAttribute(ccIDX.Start_Stop_Management_Flag, 1);
            success &= MB.SetAttribute(ccPDR.MessageName, pkt.Data);
            success &= MB.SetAttribute(ccPDR.Message_Number, pkt.Value);
            MB.SetAttribute(ccIDX.Start_Stop_Management_Flag, 2);
            AsyncComplete ac = new AsyncComplete(MB, pkt)
            {
                Success = success
            };

            parent.Invoke(new EventHandler(delegate { Complete(this, ac); }));
        }