Exemplo n.º 1
0
 /// <summary>
 /// Fast config, and No TypeData conversion.</summary>
 public DAConfClass(int idDA, int idDv, bool En, bool isWrite, bool Tohist, DriverConfig.DatType TypeData, int DBnum, string StarAdd, int NumOfVars)
 {
     ID           = idDA;
     ID_Driver    = idDv;
     DBnumber     = DBnum;
     StartAddress = StarAdd;
     Amount       = NumOfVars;
     Write        = isWrite;
     Enable       = En;
     dataType     = TypeData;
     ToHistorics  = Tohist;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Fast config, and integer to TypeData conversion.</summary>
        public DAConfClass(int idDA, int idDv, bool En, bool isWrite, bool Tohist, int TypeData, int DBnum, string StarAdd, int NumOfVars)
        {
            ID           = idDA;
            ID_Driver    = idDv;
            DBnumber     = DBnum;
            StartAddress = StarAdd;
            Amount       = NumOfVars;
            Write        = isWrite;
            Enable       = En;
            ToHistorics  = Tohist;

            switch (TypeData)
            {
            case 1:
                dataType = DriverConfig.DatType.Bool;
                break;

            case 2:
                dataType = DriverConfig.DatType.Byte;
                break;

            case 3:
                dataType = DriverConfig.DatType.Word;
                break;

            case 4:
                dataType = DriverConfig.DatType.DWord;
                break;

            case 5:
                dataType = DriverConfig.DatType.sDWord;
                break;

            case 6:
                dataType = DriverConfig.DatType.Real;
                break;

            case 7:
                dataType = DriverConfig.DatType.String;
                break;

            default:
                dataType = DriverConfig.DatType.Undefined;
                break;
            }
        }