示例#1
0
 public Variable(int pBaseAddress, PD_Length pSize, int pLength, string pName)
 {
     if (pBaseAddress < 0 || pLength <= 0 || (pLength > (int)pSize * 8 || pLength > this._maxVariableLength))
     {
         this.BaseAddress = 0;
         this.Length      = 0;
         this.BitOffset   = 0;
         this.VarType     = VarType.Unknown;
     }
     else
     {
         this.BaseAddress = pBaseAddress;
         this.Length      = pLength;
         this.BitOffset   = 0;
         this.VarType     = VarType.UInt64;
         this.CalcMinMaxRange();
         this.ByteLength = (int)pSize;
         if (pName != "Input" && pName != "Output")
         {
             this.Name = pName;
         }
         else
         {
             this.Name = string.Format("{0} {1}.{2}", (object)pName, (object)this.BaseAddress.ToString(), (object)this.BitOffset.ToString());
         }
     }
 }
示例#2
0
 public VarOutput(int pBaseAddress, PD_Length pSize, int pLength, string pName)
     : base(pBaseAddress, pSize, pLength, string.IsNullOrEmpty(pName) ? "Output" : pName)
 {
     this._outValue = this.MinValue;
 }
示例#3
0
 public VarOutput(int pBaseAddress, PD_Length pSize, int pLength, int pBitOffset)
     : this(pBaseAddress, pSize, pLength, pBitOffset, "Output")
 {
 }
示例#4
0
 public VarOutput(int pBaseAddress, PD_Length pSize, int pLength)
     : this(pBaseAddress, pSize, pLength, "Output")
 {
 }
示例#5
0
 public VarInput(int pBaseAddress, PD_Length pSize, int pLength, int pBitOffset, string pName)
     : base(pBaseAddress, pSize, pLength, pBitOffset, string.IsNullOrEmpty(pName) ? "Input" : pName)
 {
     this._inpValue = this.MinValue;
 }