Time of Day

cmhockman1978

Member
Join Date
Apr 2007
Location
PA
Posts
3
I am creating a temp control system for a school project. At this point I have a very basic system and I am trying to add the "bells and whistles."

Can anyone point me in the right direction to have the temp settings change by a clock or time of day which are programmed in by the user.

I am using a GE Fanuc 90-30 PLC

Thanks
 
Few more details may help. What software, which 90-30? May want to look at the SVCREQ instructions. Offer more details and one of the GE gurus may offer much more.
 
i decided not to use the svcreq and to use the time on the hmi (wonderware) so that poses a new question
how can i get the day of the week from there?
i can only find the day of the month which is no help
 
Is this what you need...?

Code:
{DAY NUMBER}
{Find day of week, short format "Sat", "Sun" etc.}
SecondsSince010170 = (86400 * $DateTime);
DayNameStr = StringFromTime(SecondsSince010170,4);
 
{Convert day name string to day number string}
IF DayNameStr == "Sun" THEN
	DayNumberStr = "1";
ENDIF;
IF DayNameStr == "Mon" THEN
	DayNumberStr = "2";
ENDIF;
IF DayNameStr == "Tue" THEN
	DayNumberStr = "3";
ENDIF;
IF DayNameStr == "Wed" THEN
	DayNumberStr = "4";
ENDIF;
IF DayNameStr == "Thu" THEN
	DayNumberStr = "5";
ENDIF;
IF DayNameStr == "Fri" THEN
	DayNumberStr = "6";
ENDIF;
IF DayNameStr == "Sat" THEN
	DayNumberStr = "7";
ENDIF;

In this example:
SecondsSince010170 is a REAL TAG
DayNameStr is a MESSAGE tag
DayNumberStr is a MESSAGE tag

It should be easy enough to adapt it to your exact requirement..

Kevin H
 
Last edited:
thanks alot
that's exactly what i needed and i was about halfway through writing my own script
i'll have to test it out
thanks again
chris
 
Back
Top Bottom