示例#1
0
 public string WriteSPAzAtten(byte value)
 {
     try
     {
         byte num  = (byte)PortAccessAPI.Input(this._Address);
         byte num2 = (byte)(num & 0x80);
         PortAccessAPI.Output(this._Address, (byte)(num2 + value));
     }
     catch (Exception exception)
     {
         return(exception.Message);
     }
     return("");
 }
示例#2
0
 public string WriteSPAzPower(bool state)
 {
     try
     {
         ushort num2;
         byte   num = (byte)PortAccessAPI.Input(this._Address);
         if (state)
         {
             num2 = (ushort)(num & 0x7f);
         }
         else
         {
             num2 = (ushort)(num | 0x80);
         }
         PortAccessAPI.Output(this._Address, (byte)num2);
     }
     catch (Exception exception)
     {
         return(exception.Message);
     }
     return("");
 }