# B&R DTStruct Microsec doesn't count

**URL:** <https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994>\
**Category:** B&R Software & Runtime\
**Tags:** automation-studio, automation-runtime, plc\
**Created:** [August 6, 2024, 1:42pm UTC](https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994 "2024-08-06T13:42:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![omer.alumur](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/omer.alumur/32/7383_2.png) [@omer.alumur](https://community.br-automation.com/u/omer.alumur)\
**Post date:** [August 6, 2024, 1:42pm UTC](https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994/1 "2024-08-06T13:42:52Z")

</div>

Hello everyone,

I use the following struct structure to get the time information from the NTP Server.

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/d/d9f81c6784023ea33e7e9e21b2a2d04971baafdc.png)

However, the microsecond value specified in this structure does not change when I use the function, I can only read values up to milliseconds. What could be the reason? Also, is it possible to get it in nanoseconds?

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/a/af92f7c648e8e93d6fc8436ecd2edb534235bfe2.png)

---

<div class="post-metadata">

**Author:** ![Rbn](https://avatars.discourse-cdn.com/v4/letter/r/FF8800/32.png) [@Rbn](https://community.br-automation.com/u/Rbn)\
**Post date:** [August 6, 2024, 2:19pm UTC](https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994/2 "2024-08-06T14:19:29Z")

</div>

Check if it could be due to the scan cycle of your programme.

---

<div class="post-metadata">

**Author:** ![alexander.hefner](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/alexander.hefner/32/111_2.png) [@alexander.hefner](https://community.br-automation.com/u/alexander.hefner)\
**Post date:** [August 6, 2024, 4:03pm UTC](https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994/3 "2024-08-06T16:03:33Z")

</div>

Hi,  
the microseconds element is included only for some compatibility reasons in the DTstructure, but isn’t used.

The’re possibilities to get microsecond information from the runtime, for example AsIOGetTimestamp() function, normally used for timespan topics (like doing some measurement or so), not for absolute time or date and time (of course you could combine such information If needed).  
Nanosecond information isn’t provided in both cases, as I know.

What’s the usecase behind?

Best regards!

---

<div class="post-metadata">

**Author:** ![Matt\_Buck](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@Matt\_Buck](https://community.br-automation.com/u/Matt_Buck)\
**Post date:** [August 6, 2024, 6:08pm UTC](https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994/4 "2024-08-06T18:08:41Z")

</div>

The help does state that the DTStructure and TimeStructure include the microseconds for compatibility. If you are using a DT, DATE\_AND\_TIME variable to initialize your structure, you won’t get any values for microseconds. The DATE\_AND\_TIME and DATE data types used as the bases for these structures are defined by the IEC 61131-3 standard, which are measuring seconds since UNIX epoch (i.e. Jan 1, 1970 00:00).

NTP is only meant to calibrate machines to within a few milliseconds anyways; as Stratum 1 machines, i.e. devices connected to the atomic clocks, will be microseconds off the device anyways.

---

<div class="post-metadata">

**Author:** ![omer.alumur](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/omer.alumur/32/7383_2.png) [@omer.alumur](https://community.br-automation.com/u/omer.alumur)\
**Post date:** [August 7, 2024, 8:24am UTC](https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994/5 "2024-08-07T08:24:07Z")

</div>

Nanosecond information was requested by one of our customers and I could not understand exactly why. After explaining that our controller works with 2500 Hz and therefore we could not provide such sensitive information even if we wanted to, they gave up their request. Thank you for your help anyway.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/brcommunity/original/1X/a202d64f0f03e22a662ed33fbbca6879f1efb794.jpeg) [@system](https://community.br-automation.com/u/system)\
**Post date:** [September 11, 2024, 5:55am UTC](https://community.br-automation.com/t/b-r-dtstruct-microsec-doesnt-count/3994/6 "2024-09-11T05:55:40Z")

</div>

Automatically bumped on September 11, 2024, 5:55am UTC


