setting clock in wago 750-862

ganutenator

Lifetime Supporting Member
Join Date
May 2002
Location
kansas
Posts
1,440
Does anyone know how to set the time and date programmatically in the wago 750-862?
Or direct me to the library that I need & link?
I am using codesys v2.3.9.62
 
Last edited:
figured it out
Code:
currentDT := SysRtcGetTime(dummy);

IF hmi_set_clock THEN
	sYear := INT_TO_STRING(iYear);
	sMonth := INT_TO_STRING(iMonth);
	sDay := INT_TO_STRING(iDay);
	sHour := INT_TO_STRING(iHour);
	sMinute := INT_TO_STRING(iMinute);
	sSecond := INT_TO_STRING(iSecond);

	sNewTime := CONCAT('DT#',sYear);
	sNewTime := CONCAT(sNewTime,'-' );
	sNewTime := CONCAT(sNewTime,sMonth);
	sNewTime := CONCAT(sNewTime,'-' );
	sNewTime := CONCAT(sNewTime,sDay);
	sNewTime := CONCAT(sNewTime,'-' );
	sNewTime := CONCAT(sNewTime,sHour);
	sNewTime := CONCAT(sNewTime,':' );
	sNewTime := CONCAT(sNewTime,sMinute);
	sNewTime := CONCAT(sNewTime,':' );
	sNewTime := CONCAT(sNewTime,sSecond);

	dtSetTime := STRING_TO_DT(sNewTime);
	SysRtcSetTime(dtSetTime);

	hmi_set_clock := FALSE;
	MikeCount:= MikeCount + 1;
END_IF

tPlcTimeRun:= TIME();
iPlcTimeRun:= TIME_TO_INT(tPlcTimeRun);
 
And how to read the time from the plc.

(*get current time*)

MyCurTimeEx(SystemTime:= MySystemTime, TimeDate:= MyTimeDate );

hour:= MyTimeDate.Hour;
minute:= MyTimeDate.Minute;
second:= MyTimeDate.Second;
 

Similar Topics

Whenever I test an application it will reset the clock on my computer back to 1998 (in turn kicking me off line) Anyone know what would cause...
Replies
1
Views
1,750
Hi everyone, I am a greenhorn in programming. Can anyone help me with a GX Works ladder logic example of programming a real time clock. I want to...
Replies
3
Views
4,010
Hi Guys, This is my first post on here where I have not been able to find my answer to a problem from a members previous posting. I would like...
Replies
3
Views
2,759
I understand how to connect to the HMI, and Send the current Time and date from the Laptop to the HMI using Crimson 3.0 When I power down the...
Replies
3
Views
3,584
hello everyone, I'm trying to set the system clock on my plc for daylight savings time so the operator does not need to adjust himself twice a...
Replies
1
Views
2,416
Back
Top Bottom