Ejemplo n.º 1
0
        private FunNum03RequestDataBase CovertToSingleFunNum03RequestDataBase(FunNum03CustomerRequestData funNum03CustomerRequestData)
        {
            FunNum03RequestDataBase funNumRequestDataBase = new FunNum03RequestDataBase();

            funNumRequestDataBase.DeviceAddress = funNum03CustomerRequestData.DeviceAddress;
            funNumRequestDataBase.FunctionNum   = Convert.ToByte(Convert.ToInt32(funNum03CustomerRequestData.FunctionNum));
            funNumRequestDataBase.StartingRegisterAddressHigh = (byte)(funNum03CustomerRequestData.StartingRegisterAddress / 256);
            funNumRequestDataBase.StartingRegisterAddressLow  = (byte)(funNum03CustomerRequestData.StartingRegisterAddress % 256);
            funNumRequestDataBase.NumOfRegisterToReadHigh     = (byte)(funNum03CustomerRequestData.NumOfRegisterToRead / 256);
            funNumRequestDataBase.NumOfRegisterToReadLow      = (byte)(funNum03CustomerRequestData.NumOfRegisterToRead % 256);

            return(funNumRequestDataBase);
        }
Ejemplo n.º 2
0
        public List <FunNum03RequestDataBase> CovertToFunNum03RequestDataBases()
        {
            List <FunNum03RequestDataBase> funNum03RequestDataBases = new List <FunNum03RequestDataBase>();

            List <FunNum03CustomerRequestData> funNum03CustomerRequestDatas = Splite();

            foreach (FunNum03CustomerRequestData item in funNum03CustomerRequestDatas)
            {
                FunNum03RequestDataBase funNum03RequestDataBase = CovertToSingleFunNum03RequestDataBase(item);
                funNum03RequestDataBases.Add(funNum03RequestDataBase);
            }

            return(funNum03RequestDataBases);
        }