It is currently Thu Apr 17, 2014 7:17 pm




Post new topic Reply to topic  [ 6 posts ] 
 Window popup time of day 
Author Message
Cadet
Cadet

Joined: Thu Jun 28, 2012 11:44 am
Posts: 8
Post Window popup time of day
I would like to be able to open a window at a specific time of day. Appreciate any help on this.


Fri Jun 29, 2012 8:06 am
Profile
Moderator
Moderator

Joined: Wed Apr 18, 2007 11:00 am
Posts: 645
Location: Sacramento Ca.
Post Re: Window popup time of day
You can use a Client Timer Script! You can find it in the designer under Project -> Event Scripts (Client). I would make one that ran every minute and opened the window on a specific time. Just make sure you check the time at the beginning of the script.

_________________
Robert McKenzie
Inductive Automation
Technical Support


Fri Jun 29, 2012 8:23 am
Profile WWW
Cadet
Cadet

Joined: Thu Jun 28, 2012 11:44 am
Posts: 8
Post Re: Window popup time of day
Could you give an example of how it would be written. I am quite new to Ignition and the scripting aspect of it all. Thanks.


Fri Jun 29, 2012 8:27 am
Profile
Moderator
Moderator

Joined: Wed Apr 18, 2007 11:00 am
Posts: 645
Location: Sacramento Ca.
Post Re: Window popup time of day
Code:
from time import localtime, strftime
curTime = strftime("%H:%M", localtime())
print curTime

if curTime == "17:30":
   #it's beer thirty!
   system.tag.write("Beer Cask 1/Flow Control/open", 1)

_________________
Robert McKenzie
Inductive Automation
Technical Support


Fri Jun 29, 2012 9:08 am
Profile WWW
Cadet
Cadet

Joined: Thu Jun 28, 2012 11:44 am
Posts: 8
Post Re: Window popup time of day
thanks works with system.tag.write("Beer Cask 1/Flow Control/open", 1) being replaced with system.nav.openWindow("windowname")


Fri Jun 29, 2012 9:28 am
Profile
Moderator
Moderator

Joined: Mon Jun 04, 2012 8:53 am
Posts: 440
Post Re: Window popup time of day
That's correct, although if you're opening a window, system.nav.swapTo("windowname") will be the way to go. This function will properly handle closing the window that was previously in focus and open the new one. If you're just opening a popup, then openWindow works fine.

_________________
James Lorenz
QA/Build Systems Engineer
Inductive Automation


Fri Jun 29, 2012 9:44 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: