Пример #1
0
 public void buildVarHashSet()
 {
     for (UInt16 i = startTag; i < startTag + tagNum; i++)
     {
         Space         space = ModbusProtocol.getSpace(function);
         ModbusAddress addr  = new ModbusAddress(space, i);
         if (globalObject.addrVarMap.ContainsKey(addr))
         {
             mVarSet.Add(globalObject.addrVarMap[addr]);
         }
     }
 }
Пример #2
0
        protected void setVarsState(VarState state)
        {
            if (mGlobalObject != null && mGlobalObject.addrVarMap != null)
            {
                Space space = ModbusProtocol.getSpace(mQuery.function);

                for (UInt16 i = mQuery.startTag; i < mQuery.startTag + mQuery.tagNum; i++)
                {
                    ModbusAddress currAddr = new ModbusAddress(space, i);
                    if (mGlobalObject.addrVarMap.ContainsKey(currAddr))
                    {
                        mGlobalObject.addrVarMap[currAddr].state = VarState.TimeOut;
                    }
                }
            }
        }