codesysstructured-textiec61131-3

How to adjust the time in a trend object in Codesys?


I have a trend object which takes the time of the Raspberry Pi. In my project I take the time of the main board and now the time of the trend object, the date range selection and the time displayed on the screen are different. My question is how do I set the time of the trend and the date range selection that it matches the system time? And from where do this elements take the time?

One quick fix could be to set the time of the Raspberry Pi the same as the system time, but this does not explain that there were three different times.


Solution

  • I tried the trick with the restarting of the Raspberry Pi, but I found out that the time of the trend is only set once when you first flash the project to the Raspberry Pi. So you would have to manage the time of the plot by your own to synchronize it with the main board time.