public void WriteMasksTest()
        {
            plcAccessor       = PLCAccessor.Instance;
            plcAccessor.PlcIP = "192.168.18.18";
            bool   ok      = false;
            string message = "";

            try
            {
                plcAccessor.Connect();
                plcAccessor.WriteMasks(1, 258, 0x0F);
                plcAccessor.WriteMasks(1, 258, false, 0, 1, 2, 3, 4, 5, 6, 7);
                plcAccessor.WriteMasks(1, 258, true, 1, 3);
                plcAccessor.WriteString(1, 0, 256, "abcdesffgassd");
                //plcAccessor.WriteASCIIString(1, 258, "ab");
                plcAccessor.ReadASCIIString(1, 258, 2, out message);
                plcAccessor.ReadString(1, 0, 256, out message);
                plcAccessor.ReadMask(1, 258, 3, out ok);
                plcAccessor.Disconnect();
            }
            catch (InvalidOperationException ex)
            {
                Trace.WriteLine(ex.Message);
            }
            Assert.AreEqual(ok, true);
        }
 private void OnError()
 {
     _plcAccessor.ReadMask(_dbNumber, 0, 6, out _error);
     if (_error)
     {
         ErrorEvent?.BeginInvoke(this, null, null, null);
         MyEventAggregator.Inst.GetEvent <CmmErrorEvent>().Publish(new CmmErrorStatus()
         {
             CmmNo = 1, Error = true
         });
     }
 }