Beispiel #1
0
        public static void PLC放入對應的R位置(string ReciveStr)
        {
            int ResponseLen = ReciveStr.Length;

            if (ResponseLen == (GlobalData.PLC_R區結束位址 - GlobalData.PLC_R區起始位址))
            {
                int k = 0;
                for (int j = 0; j < GlobalData.PLC_R_Scan_NUM; j++)
                {
                    GlobalData.R[GlobalData.PLC_R區起始位址 + j + ((0) * GlobalData.PLC_R_Scan_NUM)] = APP.紀錄字串轉int(ReciveStr.Substring(k, 1));
                    k = k + 1;
                }
            }
        }
Beispiel #2
0
        public static void PLC放入對應的DM位置(string ReciveStr)
        {
            int ResponseLen = ReciveStr.Length / 5;

            if (ResponseLen == (GlobalData.PLC_D區結束位址 - GlobalData.PLC_D區起始位址))
            {
                int k = 0;
                for (int j = 0; j < GlobalData.PLC_DM_Scan_NUM; j++)
                {
                    GlobalData.DM[GlobalData.PLC_D區起始位址 + j + ((0) * GlobalData.PLC_DM_Scan_NUM)] = APP.紀錄字串轉int(ReciveStr.Substring(k, 5));
                    GlobalData.DM[GlobalData.PLC_D區起始位址 + j + ((0) * GlobalData.PLC_DM_Scan_NUM)] = 各種進位轉換(ReciveStr.Substring(k, 5), 10, 16);
                    var xxx = 各種進位轉換(ReciveStr.Substring(k, 5), 10, 16);
                    k = k + 5;
                }
            }
        }