hometownjamie
How does OpenPLC handle clock setting on power up?  In my case, I plan to use an ESP32. Is this user customizable? There are choices for me:
  • query an NTP server
  • fetch time of day from another PLC on the network via modbus
  • make a call to a custom UDP server on the network
  • add RTC hardware to the ESP32
Reply 0 0
thiagoralves
OpenPLC does not query time on microcontrollers. It uses system time on Linux-based targets. For microcontrollers you can write a C/C++ block for that if you want.
Reply 0 0
hometownjamie
I guess it would run on the microcontroller and the function be called by OpenPLC on boot. Please correct me if I'm wrong. Is there a reference to access the real time variables in a ladder program?
Reply 0 0
thiagoralves
A C/C++ block can have any code and logic you want. You can set it to run on boot and query time from somewhere (either NTP server or a RTC chip on your board, or something else). Then you can store the time on variables shared with the PLC program (variables declared at the top of the block are shared)
Reply 0 0
Reply