For the last couple of hours, I am facing problems with changing system date and time by structured-text programming. I have used function block FB_LocalSystemTime where I can read the system time. But I could not find any function or function block to write new system time. I have checked NT_SetLocalTime, that also did not work. Do you have any idea how can I do that?
For further information: I have included the sample code like:
/** Declaration Part **/ fbLocalSystemTime:FB_localSystemTime; fbSetLocalTime:NT_SetLocalTime; newTime:TIMESTRUCT:=(wHour:=5); /** DEFINITION PART **/ fbLocalSystemTime(); /*This gives system time */ fbSetLocalTime.TIMESTR:=newTimne; /* New time to set */ fbSetLocalTime.START:=TRUE; fbSetLocalTime(); /** This does NOT set the system time which I guess should set **/