Intentionally or not daveSetPLCTimeToSystime is changing day of week in unpredictable manner.
It is easy to check it by executing SFC0 or reading local data (eg. OB35_DATE_TIME in OB35).
BTW. Great project - thx!
Regards,
Pawel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Intentionally or not daveSetPLCTimeToSystime is changing day of week in unpredictable manner.
It is easy to check it by executing SFC0 or reading local data (eg. OB35_DATE_TIME in OB35).
BTW. Great project - thx!
Regards,
Pawel
Fix:
int DECL2 daveSetPLCTimeToSystime(daveConnection * dc) {
int res, len;
PDU p2;
uc pa[]={0,1,18,4,17,'G',2,0};
{.....
ts[9]=daveToBCD(t1.tv_usec%100); <- here in Most Significant Decade write time of the week
.....}
Regards,
Pawel
phryniszak@gmail.com