Extract timestamp from 32-bit modbus-register
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.
When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.

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
add a comment |
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.
When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.

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
add a comment |
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.
When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.

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
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.
When I look the values in these registers I get 3 for register 1013 and 17961 for register 1014.

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
date time modbus-tcp
asked Nov 12 '18 at 13:37
NECben067NECben067
146
146
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered Nov 22 '18 at 17:17
grapesgrapes
3,6901218
3,6901218
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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