Loading ...
Sorry, an error occurred while loading the content.

Reading history.dat

Expand Messages
  • David Higgins
    Well I m stumped already (I did say my skills were somewhat limited). I have VB 6 and cannot make heads or tails of opening and reading a Binary file like
    Message 1 of 11 , Aug 8, 2005
    • 0 Attachment
      Well I'm stumped already (I did say my skills were somewhat limited).
      I have VB 6 and cannot make heads or tails of opening and reading a
      Binary file like History.dat. Can anyone shed some light? (I do have
      the fiel format)

      Cheers

      David
    • wuhu_software
      Dave, Sorry, I am a C/C++ programmer. I have never really spent any time with VB. I have a friend who is a VB programmer, maybe they can help. Any VB
      Message 2 of 11 , Aug 8, 2005
      • 0 Attachment
        Dave,

        Sorry, I am a C/C++ programmer. I have never really spent any time
        with VB.

        I have a friend who is a VB programmer, maybe they can help.

        Any VB programmers here?

        Thanks.

        --- In wuhu_software_group@yahoogroups.com, "David Higgins"
        <higginsdj@b...> wrote:
        > Well I'm stumped already (I did say my skills were somewhat
        limited).
        > I have VB 6 and cannot make heads or tails of opening and reading a
        > Binary file like History.dat. Can anyone shed some light? (I do
        have
        > the fiel format)
        >
        > Cheers
        >
        > David
      • David Higgins
        Well history has a save as text function so I can always do that first then read the resultant file. Interesting that Heavyweather doesn t give you access to
        Message 3 of 11 , Aug 8, 2005
        • 0 Attachment
          Well history has a 'save as text' function so I can always do that
          first then read the resultant file.

          Interesting that Heavyweather doesn't give you access to the history
          unless you are connected to your weather station!

          Cheers

          David

          --- In wuhu_software_group@yahoogroups.com, "wuhu_software"
          <wuhu_software@y...> wrote:
          >
          > Dave,
          >
          > Sorry, I am a C/C++ programmer. I have never really spent any time
          > with VB.
          >
          > I have a friend who is a VB programmer, maybe they can help.
          >
          > Any VB programmers here?
          >
          > Thanks.
          >
          > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
          > <higginsdj@b...> wrote:
          > > Well I'm stumped already (I did say my skills were somewhat
          > limited).
          > > I have VB 6 and cannot make heads or tails of opening and
          reading a
          > > Binary file like History.dat. Can anyone shed some light? (I
          do
          > have
          > > the fiel format)
          > >
          > > Cheers
          > >
          > > David
        • David Higgins
          If you have a chunck of C/C++ code (that does not use pointers) that reads histroy.dat then I can probably decipher it! Cheers David ... reading a ... do
          Message 4 of 11 , Aug 8, 2005
          • 0 Attachment
            If you have a chunck of C/C++ code (that does not use pointers) that
            reads histroy.dat then I can probably decipher it!

            Cheers

            David

            --- In wuhu_software_group@yahoogroups.com, "wuhu_software"
            <wuhu_software@y...> wrote:
            >
            > Dave,
            >
            > Sorry, I am a C/C++ programmer. I have never really spent any time
            > with VB.
            >
            > I have a friend who is a VB programmer, maybe they can help.
            >
            > Any VB programmers here?
            >
            > Thanks.
            >
            > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
            > <higginsdj@b...> wrote:
            > > Well I'm stumped already (I did say my skills were somewhat
            > limited).
            > > I have VB 6 and cannot make heads or tails of opening and
            reading a
            > > Binary file like History.dat. Can anyone shed some light? (I
            do
            > have
            > > the fiel format)
            > >
            > > Cheers
            > >
            > > David
          • David Higgins
            Well oddly enough I couldn t do it with VB 6 but I could do the read with VB.net!!!! Anyway, I have (I think) successfully extracted the data but need some way
            Message 5 of 11 , Aug 9, 2005
            • 0 Attachment
              Well oddly enough I couldn't do it with VB 6 but I could do the read
              with VB.net!!!!

              Anyway, I have (I think) successfully extracted the data but need some
              way of interpreting the float values. For example I extract the
              following:

              680153154 = 514.50 hpa Air Pressure
              656214392 = 11.91 mm Rainfall
              656214392205 = 19.10 deg C Indoor Temp
              65156204205 = 19.60 deg C Outdoor Temp

              Also, Can anyone point me to an algorythm to add seconds to 00:00:00
              01/01/1900 GMT to get actual time?

              Cheers

              David
            • David Higgins
              A little whoopsie in my last mail. 680153154 = 514.50 hpa Air Pressure 0000 = 0.0 m/s Wind Speed 656214392 = 11.91 mm (0.47 in) Rainfall 65152204205 = 19.10
              Message 6 of 11 , Aug 9, 2005
              • 0 Attachment
                A little whoopsie in my last mail.

                680153154 = 514.50 hpa Air Pressure
                0000 = 0.0 m/s Wind Speed
                656214392 = 11.91 mm (0.47 in) Rainfall
                65152204205 = 19.10 deg C (66.38 f) Indoor Temp**
                65156204205 = 19.60 deg C (67.28 f) Outdoor Temp

                Cheers

                David
                --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                <higginsdj@b...> wrote:
                > Well oddly enough I couldn't do it with VB 6 but I could do the
                read
                > with VB.net!!!!
                >
                > Anyway, I have (I think) successfully extracted the data but need
                some
                > way of interpreting the float values. For example I extract the
                > following:
                >
                > 680153154 = 514.50 hpa Air Pressure
                > 656214392 = 11.91 mm Rainfall
                > 656214392205 = 19.10 deg C Indoor Temp
                > 65156204205 = 19.60 deg C Outdoor Temp
                >
                > Also, Can anyone point me to an algorythm to add seconds to
                00:00:00
                > 01/01/1900 GMT to get actual time?
                >
                > Cheers
                >
                > David
              • David Higgins
                AND, just in case it helps to have the byte values separated: 68 0 153 154 65 62 143 92 65 152 204 205 65 156 204 205 David ... need
                Message 7 of 11 , Aug 9, 2005
                • 0 Attachment
                  AND, just in case it helps to have the byte values separated:

                  68 0 153 154
                  65 62 143 92
                  65 152 204 205
                  65 156 204 205

                  David
                  --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                  <higginsdj@b...> wrote:
                  > A little whoopsie in my last mail.
                  >
                  > 680153154 = 514.50 hpa Air Pressure
                  > 0000 = 0.0 m/s Wind Speed
                  > 656214392 = 11.91 mm (0.47 in) Rainfall
                  > 65152204205 = 19.10 deg C (66.38 f) Indoor Temp**
                  > 65156204205 = 19.60 deg C (67.28 f) Outdoor Temp
                  >
                  > Cheers
                  >
                  > David
                  > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                  > <higginsdj@b...> wrote:
                  > > Well oddly enough I couldn't do it with VB 6 but I could do the
                  > read
                  > > with VB.net!!!!
                  > >
                  > > Anyway, I have (I think) successfully extracted the data but
                  need
                  > some
                  > > way of interpreting the float values. For example I extract the
                  > > following:
                  > >
                  > > 680153154 = 514.50 hpa Air Pressure
                  > > 656214392 = 11.91 mm Rainfall
                  > > 656214392205 = 19.10 deg C Indoor Temp
                  > > 65156204205 = 19.60 deg C Outdoor Temp
                  > >
                  > > Also, Can anyone point me to an algorythm to add seconds to
                  > 00:00:00
                  > > 01/01/1900 GMT to get actual time?
                  > >
                  > > Cheers
                  > >
                  > > David
                • David Higgins
                  OK - I ve nutted out the binary to float conversion for VB. Just need to work out an easy method of adding x trillion seconds to 00:00:00 01/01/1900 to get
                  Message 8 of 11 , Aug 9, 2005
                  • 0 Attachment
                    OK - I've nutted out the binary to float conversion for VB. Just
                    need to work out an easy method of adding x trillion seconds to
                    00:00:00 01/01/1900 to get the correct date and time.

                    Cheer

                    David

                    --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                    <higginsdj@b...> wrote:
                    > AND, just in case it helps to have the byte values separated:
                    >
                    > 68 0 153 154
                    > 65 62 143 92
                    > 65 152 204 205
                    > 65 156 204 205
                    >
                    > David
                    > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                    > <higginsdj@b...> wrote:
                    > > A little whoopsie in my last mail.
                    > >
                    > > 680153154 = 514.50 hpa Air Pressure
                    > > 0000 = 0.0 m/s Wind Speed
                    > > 656214392 = 11.91 mm (0.47 in) Rainfall
                    > > 65152204205 = 19.10 deg C (66.38 f) Indoor Temp**
                    > > 65156204205 = 19.60 deg C (67.28 f) Outdoor Temp
                    > >
                    > > Cheers
                    > >
                    > > David
                    > > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                    > > <higginsdj@b...> wrote:
                    > > > Well oddly enough I couldn't do it with VB 6 but I could do
                    the
                    > > read
                    > > > with VB.net!!!!
                    > > >
                    > > > Anyway, I have (I think) successfully extracted the data but
                    > need
                    > > some
                    > > > way of interpreting the float values. For example I extract
                    the
                    > > > following:
                    > > >
                    > > > 680153154 = 514.50 hpa Air Pressure
                    > > > 656214392 = 11.91 mm Rainfall
                    > > > 656214392205 = 19.10 deg C Indoor Temp
                    > > > 65156204205 = 19.60 deg C Outdoor Temp
                    > > >
                    > > > Also, Can anyone point me to an algorythm to add seconds to
                    > > 00:00:00
                    > > > 01/01/1900 GMT to get actual time?
                    > > >
                    > > > Cheers
                    > > >
                    > > > David
                  • wuhu_software
                    David, Found some info here that may help: http://www.codeguru.com/forum/archive/index.php/t-12573.html a time_t value is a long (32 bit) that represents the
                    Message 9 of 11 , Aug 10, 2005
                    • 0 Attachment
                      David,

                      Found some info here that may help:
                      http://www.codeguru.com/forum/archive/index.php/t-12573.html

                      a time_t value is a long (32 bit) that represents the number of
                      seconds since 1/1/1970.

                      Thus, you can convert it to a VB date:

                      ' read yourLongValue from the file
                      dim epoch as date
                      epoch = #1/1/1970#
                      msgbox dateadd("s", yourLongValue,epoch)

                      Therefore, I think you can just change the 1/1/1970 to 1/1/1900.

                      The dateadd function should take care of all of the details.

                      I am not sure, but I think TimeValue may return the time of day from
                      the result of dateadd.

                      Good luck.

                      ---

                      Here is an example of how to perform the calculations in C where
                      time_t is a 32 bit integer representing the seconds since 1/1/1970
                      (native C time format).

                      #define SECONDSPERMINUTE (cyg_uint32)60
                      #define SECONDSPERHOUR (cyg_uint32)(SECONDSPERMINUTE * 60)
                      #define SECONDSPERDAY (cyg_uint32)(SECONDSPERHOUR * 24)
                      #define SECONDSPERYEAR (cyg_uint32)(SECONDSPERDAY * 365)

                      /* Convert a SNTP timestamp to a time_t. timestamps are seconds from
                      1/1/1900. time_t is 1/1/1970. That equates to 70 years, or which
                      17 were leap years.*/

                      static time_t timestamp2time(cyg_uint32 timestamp) {

                      return timestamp -
                      (SECONDSPERYEAR * (cyg_uint32)(70)) -
                      (SECONDSPERDAY * (cyg_uint32)(17));
                      }

                      --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                      <higginsdj@b...> wrote:
                      > OK - I've nutted out the binary to float conversion for VB. Just
                      > need to work out an easy method of adding x trillion seconds to
                      > 00:00:00 01/01/1900 to get the correct date and time.
                      >
                      > Cheer
                      >
                      > David
                      >
                      > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                      > <higginsdj@b...> wrote:
                      > > AND, just in case it helps to have the byte values separated:
                      > >
                      > > 68 0 153 154
                      > > 65 62 143 92
                      > > 65 152 204 205
                      > > 65 156 204 205
                      > >
                      > > David
                      > > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                      > > <higginsdj@b...> wrote:
                      > > > A little whoopsie in my last mail.
                      > > >
                      > > > 680153154 = 514.50 hpa Air Pressure
                      > > > 0000 = 0.0 m/s Wind Speed
                      > > > 656214392 = 11.91 mm (0.47 in) Rainfall
                      > > > 65152204205 = 19.10 deg C (66.38 f) Indoor Temp**
                      > > > 65156204205 = 19.60 deg C (67.28 f) Outdoor Temp
                      > > >
                      > > > Cheers
                      > > >
                      > > > David
                      > > > --- In wuhu_software_group@yahoogroups.com, "David Higgins"
                      > > > <higginsdj@b...> wrote:
                      > > > > Well oddly enough I couldn't do it with VB 6 but I could do
                      > the
                      > > > read
                      > > > > with VB.net!!!!
                      > > > >
                      > > > > Anyway, I have (I think) successfully extracted the data but
                      > > need
                      > > > some
                      > > > > way of interpreting the float values. For example I extract
                      > the
                      > > > > following:
                      > > > >
                      > > > > 680153154 = 514.50 hpa Air Pressure
                      > > > > 656214392 = 11.91 mm Rainfall
                      > > > > 656214392205 = 19.10 deg C Indoor Temp
                      > > > > 65156204205 = 19.60 deg C Outdoor Temp
                      > > > >
                      > > > > Also, Can anyone point me to an algorythm to add seconds to
                      > > > 00:00:00
                      > > > > 01/01/1900 GMT to get actual time?
                      > > > >
                      > > > > Cheers
                      > > > >
                      > > > > David
                    • David Higgins
                      LOL, I wished I knew that yesterday. Just finished writting a page of code (using an algotithm I found in Meeus Astronomical Algorithms) to work it out the
                      Message 10 of 11 , Aug 10, 2005
                      • 0 Attachment
                        LOL,

                        I wished I knew that yesterday. Just finished writting a page of
                        code (using an algotithm I found in Meeus Astronomical Algorithms)
                        to work it out the hard way :-) The Help/Search engine with VB.net
                        isn't as good as it used to be unless you knwo exactly what you are
                        looking for - which sort of defeats the purpose!

                        I have the code working spitting out correctly formed URL's. All I
                        need to do no is convert my metric values to Imperial then work out
                        how to send the URL's (should be second nature for .net) and read
                        the response.

                        David

                        --- In wuhu_software_group@yahoogroups.com, "wuhu_software"
                        <wuhu_software@y...> wrote:
                        >
                        > David,
                        >
                        > Found some info here that may help:
                        > http://www.codeguru.com/forum/archive/index.php/t-12573.html
                        >
                        > a time_t value is a long (32 bit) that represents the number of
                        > seconds since 1/1/1970.
                        >
                        > Thus, you can convert it to a VB date:
                        >
                        > ' read yourLongValue from the file
                        > dim epoch as date
                        > epoch = #1/1/1970#
                        > msgbox dateadd("s", yourLongValue,epoch)
                        >
                        > Therefore, I think you can just change the 1/1/1970 to 1/1/1900.
                        >
                        > The dateadd function should take care of all of the details.
                        >
                        > I am not sure, but I think TimeValue may return the time of day
                        from
                        > the result of dateadd.
                        >
                        > Good luck.
                        >
                        > ---
                        >
                        > Here is an example of how to perform the calculations in C where
                        > time_t is a 32 bit integer representing the seconds since 1/1/1970
                        > (native C time format).
                        >
                        > #define SECONDSPERMINUTE (cyg_uint32)60
                        > #define SECONDSPERHOUR (cyg_uint32)(SECONDSPERMINUTE * 60)
                        > #define SECONDSPERDAY (cyg_uint32)(SECONDSPERHOUR * 24)
                        > #define SECONDSPERYEAR (cyg_uint32)(SECONDSPERDAY * 365)
                        >
                        > /* Convert a SNTP timestamp to a time_t. timestamps are seconds
                        from
                        > 1/1/1900. time_t is 1/1/1970. That equates to 70 years, or
                        which
                        > 17 were leap years.*/
                        >
                        > static time_t timestamp2time(cyg_uint32 timestamp) {
                        >
                        > return timestamp -
                        > (SECONDSPERYEAR * (cyg_uint32)(70)) -
                        > (SECONDSPERDAY * (cyg_uint32)(17));
                        > }
                        >
                      • stevech
                        David I m pretty good with VB6 and I d like to collaborate on parsing the .dat file. stevech@san.rr.com ... From: wuhu_software_group@yahoogroups.com
                        Message 11 of 11 , Aug 11, 2005
                        • 0 Attachment
                          David

                          I'm pretty good with VB6 and I'd like to collaborate on parsing the .dat
                          file.

                          stevech@...

                          -----Original Message-----
                          From: wuhu_software_group@yahoogroups.com
                          [mailto:wuhu_software_group@yahoogroups.com] On Behalf Of David Higgins
                          Sent: Monday, August 08, 2005 5:09 PM
                          To: wuhu_software_group@yahoogroups.com
                          Subject: [wuhu_software_group] Reading history.dat

                          Well I'm stumped already (I did say my skills were somewhat limited).
                          I have VB 6 and cannot make heads or tails of opening and reading a
                          Binary file like History.dat. Can anyone shed some light? (I do have
                          the fiel format)

                          Cheers

                          David





                          Yahoo! Groups Links
                        Your message has been successfully submitted and would be delivered to recipients shortly.