Can't set Real Time Clock

Discuss issues and ideas you have to configuring displays with PowerVision
cconner_aie
Posts: 93
Joined: Thu Jun 11, 2015 10:12 am

Can't set Real Time Clock

Post by cconner_aie » Fri Mar 10, 2017 2:30 pm

I have a PV480 that I am trying to set the Real Time Clock with.

My code works on some panels, but not others. I think the problem is that during testing I set the System Clock variables to Survive Upgrade, I have changed this back to do not save, however I can't set the clock on this particular panel using the same code I use to successfully set the other panels.

I can provide examples if needed, but my question is how to reset the panel completely so I'm starting from scratch. I've tried to create a full install and load it but it doesn't seem to fix the problem.

Do the survives upgrade variables survive through a full install? If so how do I get them to reset?

Thanks,
Coleby Conner
Controls Engineer, Anderson Industrial Engines
boyce
Enovation Controls Development
Enovation Controls Development
Posts: 322
Joined: Wed Sep 08, 2010 5:09 pm

Re: Can't set Real Time Clock

Post by boyce » Mon Mar 20, 2017 2:39 pm

The variables that are marked Survives Upgrade will not be reset when a full install is loaded. When you change the variable to DoNotSave and load the configuration the variable will have the default value.
Boyce Schrack
Enovation Controls
cconner_aie
Posts: 93
Joined: Thu Jun 11, 2015 10:12 am

Re: Can't set Real Time Clock

Post by cconner_aie » Mon Mar 20, 2017 4:12 pm

Thank you, that is my problem. They are marked as DoNotSave:

Image

and here is my code to set the clock

Code: Select all

void applyDateTime()
{
	int year, month, day;
	int hour, minute;
	
	smRead(VariableIDs.V_DateTime_Year, year);
	smRead(VariableIDs.V_DateTime_Month, month);
	smRead(VariableIDs.V_DateTime_Day, day);
	smRead(VariableIDs.V_DateTime_Hour, hour);
	smRead(VariableIDs.V_DateTime_Minute, minute);
	
	smWrite(VariableIDs.RealTimeClock_Set_Year, year);
	smWrite(VariableIDs.RealTimeClock_Set_Month, month);
	smWrite(VariableIDs.RealTimeClock_Set_Day, day);
	smWrite(VariableIDs.RealTimeClock_Set_Hour, hour);
	smWrite(VariableIDs.RealTimeClock_Set_Minute, minute);
	smWrite(VariableIDs.RealTimeClock_Set_Second, 0);

	SendAction(ApplicationIDs.System,
		ActionIDs.System_Update_Clock,
		ActionData.Empty);

}
It works on some panels, but not this one. The only thing that is different that I can tell is that this panel had the clock variables set to SurvivesUpgrade at one point (now turned back to DoNotSave).

At this point I've started another profile from scratch and it does the same thing, is there a way to wipe the panel of everything and start from scratch like it just came from the factory? It seems as though there is a setting stuck that I can't overwrite.
Coleby Conner
Controls Engineer, Anderson Industrial Engines
boyce
Enovation Controls Development
Enovation Controls Development
Posts: 322
Joined: Wed Sep 08, 2010 5:09 pm

Re: Can't set Real Time Clock

Post by boyce » Mon Mar 20, 2017 4:29 pm

The best thing to do is to load a full install with a different configuration. When the configurations do not match it will erase all of the saved variables. Then you can put your other configuration on and it will be as close to a new unit as possible.
Boyce Schrack
Enovation Controls
cconner_aie
Posts: 93
Joined: Thu Jun 11, 2015 10:12 am

Re: Can't set Real Time Clock

Post by cconner_aie » Tue Mar 21, 2017 7:11 am

Thanks, I will try that.
Coleby Conner
Controls Engineer, Anderson Industrial Engines