Skip to main content
Solved

Round timestamp to second for OPC-UA tags in configuration file


Forum|alt.badge.img+6

Hello,

Is there a way to round timestamps of the incoming OPC UA tags to second within the configuration file? I have gone through the documentation but haven't found anything like that. The problem is that for some tags coming from an OPC UA server I make some simple transformations and these tags are coming to CDF with timestamps at ms, whereas the other tags for which I do not apply any transformation on server side, are coming with timestamp at second. The issue I encounter is when I push the data from CDF to PowerBI and pivot the data and I get 2 rows for the same timestamp which PowerBI is displaying at second, 1 row with values for the tags without transformations and the other with the tags transformed which have timestamp in ms on CDF side. I just don't want to apply another query/transformation step to round the timestamp at second on PowerBI side and on CDF this timestamp rounding should be a scheduled transformation running every minute if not every second.

 

Regards,

Raluca

Best answer by Raluca Bala

Yes, it's fine. I wanted to know if this is possible at the server side or within the OPC UA extractor but it's not yet possible.

 

Thank you,

Raluca

View original
Did this topic help you find an answer to your question?

  • Backend developer
  • August 22, 2024

Hi
If I understand you correctly, you would like to truncate the millisecond part of the time stamp (round down to the nearest second)? And that there is at most one data point per second.

You could try to use an aggregate query, using the max aggregate, and granularity 1s. Since the start of the aggregate is at the whole second, that will be the returned timestamp, and the max aggregate should return the highest value of all the data points in that second.

I’m not familiar with the details of the OPC-UA extractor, so I can’t help you with that part.

Regards,

Matias


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2

Hi @Raluca Bala,

We are following up to see whether you're satisfied with the responses you've received? 


Forum|alt.badge.img+6

Yes, it's fine. I wanted to know if this is possible at the server side or within the OPC UA extractor but it's not yet possible.

 

Thank you,

Raluca


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings