I thought this script would fire every 10 minutes the client was running and when the hour equal to 00 and the minute less tha 19 the screens would then swapTp the main menu or Navigation screen.
What have I done wrong and what would be the ccleanest way to change screens at midnight?
system.date.get* requires a date to get the specified part from. Replace your first two lines with these three:
date = system.date.now()
Hour = system.date.getHour24(date)
Minute = system.date.getMinute(date)
This won't keep it from working, but your script looks like it is running every 1,000 ms (the "600,000" shown in your screenshot above is just the name of the timer script). If someone is trying to use it during the first 18 minutes after midnight, the swap once a second would get a bit annoying!
Okay gotcha.
There are two scopes of tags. One type is scoped to the gateway. The OPC tags for example are are scoped to the gateway. gateway tags are global and be seen by all projects.
Below the Tags folder near the bottom, you should see a folder called “Client”. Client tags are tags that stay local to the Client running the project.
If you have the time, will you show me an example expression for the Client Tag (TriggerTag), Data Type Boolean that will be True when the current time is 00:01:00. Where the TagEditor Expression that is looking at the time will poll or execute every ten minutes.
I have the Client Event Script set up just like you described above, I’m having trouble getting my client tag (TriggerTag) to come true based on the current time
JordanCClark, I could sure use your help on this same issue.
My Tag is firing but the screens are not changing. I did several tests this morning and was unable to get the screens to change. Will you take a look at how I have the tag and Client Event Script setup and see if you can spot my error(s).
The first two pics are the Client Tag Editor windows.
The last two pics are the Client Event windows.
Case matters–“T” must be capitalized in “swapTo.” I believe newValue.getValue() requires the parenthesis on the end. Your script is not setting a value for OpenWindow so it is likely equal to None when your script fires. You could probably just drop the second condition, making your script:
if newValue.getValue() == True:
system.nav.swapTo("Navigation")