Extract timestamp from 32-bit modbus-register












0















So I am trying to extract the date and time from a Modbus-device (Wetspec200).
I am using the simplyModbus software to see what is written in the registers. The manual of the device says, that the timestamp is written in the registers 1013 and 1014.registers of date/time



When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.
enter image description here



How exactly can I get the timestamp out of this? I tried to bring the two registers together. The lower register represents the first 16 bit and the higher register represents the last 16 bits. So the value 3 is 00000000 00000011 in binary and 17961 is 01000110 00101001.
So merged together it would become 00000000 00000011 01000110 00101001. But that doesnt make any sense to me. Do you have any idea how I could get the date/time from these two registers?



There was a similar post about the same problem, but the answer was not right for my case.










share|improve this question



























    0















    So I am trying to extract the date and time from a Modbus-device (Wetspec200).
    I am using the simplyModbus software to see what is written in the registers. The manual of the device says, that the timestamp is written in the registers 1013 and 1014.registers of date/time



    When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.
    enter image description here



    How exactly can I get the timestamp out of this? I tried to bring the two registers together. The lower register represents the first 16 bit and the higher register represents the last 16 bits. So the value 3 is 00000000 00000011 in binary and 17961 is 01000110 00101001.
    So merged together it would become 00000000 00000011 01000110 00101001. But that doesnt make any sense to me. Do you have any idea how I could get the date/time from these two registers?



    There was a similar post about the same problem, but the answer was not right for my case.










    share|improve this question

























      0












      0








      0








      So I am trying to extract the date and time from a Modbus-device (Wetspec200).
      I am using the simplyModbus software to see what is written in the registers. The manual of the device says, that the timestamp is written in the registers 1013 and 1014.registers of date/time



      When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.
      enter image description here



      How exactly can I get the timestamp out of this? I tried to bring the two registers together. The lower register represents the first 16 bit and the higher register represents the last 16 bits. So the value 3 is 00000000 00000011 in binary and 17961 is 01000110 00101001.
      So merged together it would become 00000000 00000011 01000110 00101001. But that doesnt make any sense to me. Do you have any idea how I could get the date/time from these two registers?



      There was a similar post about the same problem, but the answer was not right for my case.










      share|improve this question














      So I am trying to extract the date and time from a Modbus-device (Wetspec200).
      I am using the simplyModbus software to see what is written in the registers. The manual of the device says, that the timestamp is written in the registers 1013 and 1014.registers of date/time



      When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.
      enter image description here



      How exactly can I get the timestamp out of this? I tried to bring the two registers together. The lower register represents the first 16 bit and the higher register represents the last 16 bits. So the value 3 is 00000000 00000011 in binary and 17961 is 01000110 00101001.
      So merged together it would become 00000000 00000011 01000110 00101001. But that doesnt make any sense to me. Do you have any idea how I could get the date/time from these two registers?



      There was a similar post about the same problem, but the answer was not right for my case.







      date time modbus-tcp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 '18 at 13:37









      NECben067NECben067

      146




      146
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Can you share the manual? As far as modbus does not specify any requirements for timestamp format, everyone goes his own way.



          If it is not written in manual, then try using its own software to extract data from device, then look (or share) the time stamp, shown in a software and try to find how it corresponds to binary value (usually it is easy).



          As far as we have only 18 non-zero bits I guess it stores only delta in seconds (or minutes) from some setpoint, which is stored separately in another register. This is a common practice for metering devices






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53263381%2fextract-timestamp-from-32-bit-modbus-register%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Can you share the manual? As far as modbus does not specify any requirements for timestamp format, everyone goes his own way.



            If it is not written in manual, then try using its own software to extract data from device, then look (or share) the time stamp, shown in a software and try to find how it corresponds to binary value (usually it is easy).



            As far as we have only 18 non-zero bits I guess it stores only delta in seconds (or minutes) from some setpoint, which is stored separately in another register. This is a common practice for metering devices






            share|improve this answer




























              0














              Can you share the manual? As far as modbus does not specify any requirements for timestamp format, everyone goes his own way.



              If it is not written in manual, then try using its own software to extract data from device, then look (or share) the time stamp, shown in a software and try to find how it corresponds to binary value (usually it is easy).



              As far as we have only 18 non-zero bits I guess it stores only delta in seconds (or minutes) from some setpoint, which is stored separately in another register. This is a common practice for metering devices






              share|improve this answer


























                0












                0








                0







                Can you share the manual? As far as modbus does not specify any requirements for timestamp format, everyone goes his own way.



                If it is not written in manual, then try using its own software to extract data from device, then look (or share) the time stamp, shown in a software and try to find how it corresponds to binary value (usually it is easy).



                As far as we have only 18 non-zero bits I guess it stores only delta in seconds (or minutes) from some setpoint, which is stored separately in another register. This is a common practice for metering devices






                share|improve this answer













                Can you share the manual? As far as modbus does not specify any requirements for timestamp format, everyone goes his own way.



                If it is not written in manual, then try using its own software to extract data from device, then look (or share) the time stamp, shown in a software and try to find how it corresponds to binary value (usually it is easy).



                As far as we have only 18 non-zero bits I guess it stores only delta in seconds (or minutes) from some setpoint, which is stored separately in another register. This is a common practice for metering devices







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 22 '18 at 17:17









                grapesgrapes

                3,6901218




                3,6901218






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53263381%2fextract-timestamp-from-32-bit-modbus-register%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Ottavio Pratesi

                    Error adding annotation colours to pheatmap in R: “more elements supplied than there are to replace”

                    15 giugno