Esempio n. 1
0
        public void Write()
        {
            int i = 0;

            lock (this)
            {
                if (Type == EAxtDio.DO)
                {
                    foreach (AxtDioWordModule module in modules)
                    {
                        i = module.ModuleNo * 2;

                        if (nowValue.Word(i) != tempValue.Word(i))
                        {
                            Validate(CAXD.AxdoWriteOutportWord(module.ModuleNo, module.Offset, tempValue.Word(i)));
                        }
                    }

                    foreach (KeyValuePair <int, UlRelayTimer> timer in timers)
                    {
                        timer.Value.IN = tempValue[timer.Key];
                    }
                }
            }
        }
Esempio n. 2
0
 public void Update()
 {
     for (int i = 0; i < m_iModuleCnt; i++)
     {
         if (m_aModuleInfo[i].iCntIn == 32 || m_aModuleInfo[i].iCntOut == 32)
         {
             CAXD.AxdoWriteOutportDword(i, 0, m_aModuleInfo[i].uDataOutSet);
             CAXD.AxdoReadOutportDword(i, 0, ref m_aModuleInfo[i].uDataOutGet);
             CAXD.AxdiReadInportDword(i, 0, ref m_aModuleInfo[i].uDataIn);
         }
         else if (m_aModuleInfo[i].iCntIn == 16 || m_aModuleInfo[i].iCntOut == 16)
         {
             CAXD.AxdoWriteOutportWord(i, 0, m_aModuleInfo[i].uDataOutSet);
             CAXD.AxdoReadOutportWord(i, 0, ref m_aModuleInfo[i].uDataOutGet);
             CAXD.AxdiReadInportWord(i, 0, ref m_aModuleInfo[i].uDataIn);
         }
         //m_aModuleInfo[i].uDataOutSet = 0;// m_aModuleInfo[i].uDataOutGet;
     }
 }