Exemple #1
0
        /// <summary>
        /// 读单个寄存器
        /// </summary>
        /// <param name="omronPLC"></param>
        /// <param name="Address">地址</param>
        /// <returns></returns>
        public static string ReadDM(OmronPLC_tcp omronPLC, string Address)
        {
            short value = 0;

            omronPLC.ReadDM(Convert.ToUInt16(Address), ref value);
            return(value.ToString());
        }
Exemple #2
0
        /// <summary>
        /// 读单个寄存器
        /// </summary>
        /// <param name="omronPLC"></param>
        /// <param name="Address">地址</param>
        /// <returns></returns>
        public static string ReadDM(OmronPLC_tcp omronPLC, string Address)
        {
            short value = 0;

            lock (TengDa.Communication.PCLock.Locker)
            {
                omronPLC.ReadDM(Convert.ToUInt16(Address), ref value);
            }
            return(value.ToString());
        }