Hello everyone!
I'm working on a P1AM project for school and need to activate some outputs based on the time of day. I'm having trouble getting the RTC time to show correctly. I've got some experience and schooling for PLC, but very little with programming or Arduino in general.
So far I've tried using the RTC block, and noticed that it starts at "1970: 00:00: etc etc" and continues to count while using the simulator (I understand this to be expected based on other posts made). The rest of my program works correctly in the simulator, as I can change the on and off times and see that they work as expected.
At the moment I do not have a way to monitor my PLC memory locations, but it appears that the RTC is NOT being updated with my PC's current time during upload. As in it seems the RTC block starts at "1970: 00:00 etc etc" when uploaded to the P1AM. I can see that the RTC block counter and the output are indeed operating, as my output changes to ON after several hours (I haven't caught it in person, but I assume it is turning on after 8 hours as I have my on time set to TOD#8:00:00.00000.
I've tried moving the time values from %ML1024 into another %ML location using:
[RTCTime (ULINT @%ML1024)] -[ULINT_to_TOD] - [MOVE] - [Time (TOD)]
As well as using the RTC function block:
[RTC Block - CDT] - [DT to TOD] - [Time var]
or
[RTC Block - CDT] - [DT to Time/Real/LReal/Word] -[MOVE] - [Time var @%ML1]
or
[RTC Block - CDT] - [DT to TOD] - [Greater/Equal TOD#8:00......]
Is there something in the above examples I can change to make this work with the P1AM, or do I need to create a new driver/function block?
I have found that the P1AM utilizes the RTCZero.h Library when using the Arduino IDE software, could someone give me some tips on how to implement that library if OpenPLC does not currently support P1AM RTC? I've struggled to find where to move the .h and .cpp files, as well as what scripts will need to edited so they call out the RTCZero files. I expect to need other drivers/libraries, so I would really appreciate tips on this regardless.
I am working on a windows PC fyi, and hope to implement Modbus communication down the road.
Thanks in advance!