protected DigitalDataRegisterDE ReadState(FileStream fstream, string Name, long HeaderLen, DateTime dateHourMinute)
        {
            BitArray myBA;

            fstream.Position = HeaderLen + ((int) htHeader[Name] * NumBValGr);
            byte[] BBuffer = new byte[NumBValGr];
            BBuffer = r.ReadBytes(NumBValGr);

            if(BBuffer.Length > 1)
            {
                byte[] aux = new byte[1];
                aux[0] = (byte) (BBuffer[1] | BBuffer[0]);
                myBA = new BitArray(aux);
            }
            else myBA = new BitArray(BBuffer);

            DigitalDataRegisterDE dataRegister = new DigitalDataRegisterDE(dateHourMinute,Name,myBA);

            return dataRegister;
        }
        public DigitalDataRegisterDE[] GetState(string[] pointName, DateTime dateHourMinute)
        {
            ArrayList dataslist = new ArrayList();
            DigitalDataRegisterDE[] states = null;
            DigitalDataRegisterDE dataRegister;

            int NumMinutes = dateHourMinute.Hour * 60 + dateHourMinute.Minute;

            if(dateHourMinute <= LastUpdate)
            {
                if(FileExists)
                {
                    fs = new FileStream(DataFileName, FileMode.Open, FileAccess.Read);
                    r = new BinaryReader(fs);

                    long headerLen = (NumGRLen + DataUltimaAtuLen + NumBValGrLen) +
                        (NumGR * (IdxLen + CodLocLen + CodNomLen + CodTipLen + ElemOperLen + TipOrigLen + NomeGRLen + NumBlankInHeader)) +
                        (NumBValGr * NumGR + DataDosValoresLen) * NumMinutes + DataDosValoresLen;

                    for(int i=0; i<pointName.Length;i++)
                    {
                        if(htHeader[pointName[i]] != null)
                        {
                            dataRegister = ReadState(fs,pointName[i],headerLen,dateHourMinute);
                            dataslist.Add(dataRegister);
                        }
                        else
                        {
                            dataRegister = new DigitalDataRegisterDE(pointName[i],dateHourMinute);
                            dataslist.Add(dataRegister);
                        }
                    }
                    if(dataslist.Count > 0) states = (DigitalDataRegisterDE[]) dataslist.ToArray(typeof(DigitalDataRegisterDE));
                }
            }
            r.Close();
            fs.Close();

            return states;
        }