Does anyone know how to get the time using C++ without using AsTime or std::chrono.
Customer is running Compact S (ARM), but should also work on standard PC / Simulation.
Kind Regards
// Johan
Does anyone know how to get the time using C++ without using AsTime or std::chrono.
Customer is running Compact S (ARM), but should also work on standard PC / Simulation.
Kind Regards
// Johan
For a motion project I converted the ErrorRecords.Record[j].TimeStamp.Seconds to a date and time with following code in c++ task.
<#include <time.h>
epoch_time = fbReadErrorText->ErrorRecords.Record[j].TimeStamp.Seconds;
time_info = localtime(&epoch_time);
result = strftime(Ax->AlarmBuffer->Data[0].Date,sizeof(Ax->AlarmBuffer->Data[0].Date),"%y-%m-%d", time_info);
result = strftime(Ax->AlarmBuffer->Data[0].Time,sizeof(Ax->AlarmBuffer->Data[0].Time),"%H:%M:%S", time_info);
I assume that <time.h> also contains a function to read out the time.
Hi Corne,
Thanks for your answer. I need to dig deeper into the topic of <time.h> and see what’s supported and not.
For anyone that would like to just get a timestamp in millisecond resolution you will have possibility to do so by using the SYS_Lib-library.