{"id":3172,"date":"2019-03-25T17:43:02","date_gmt":"2019-03-25T20:43:02","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/"},"modified":"2019-07-05T17:21:08","modified_gmt":"2019-07-05T20:21:08","slug":"kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/","title":{"rendered":"KB-57412: Demo application &#8211; Hourly programming to turn the device on\/off from a day of the week."},"content":{"rendered":"<div align=\"justify\">\n<p><b>Overview:<\/b><\/p>\n<p>This demo application demonstrates the necessary procedures to create an hourly programming considering the day of the week from the current date, and then executing commands to change\/write values in the tags referring to the device.<\/p>\n<p><b>Operation:<\/b><\/p>\n<p>Inside the Viewer there is a User Event whose function is to check the day of the week (Thursday, Friday, etc) from the date in the PC where the application is being executed. For this, use a Demo tag and set up the event to happen <b>Always when property\/expression changes its value<\/b>:<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4857\/KB-4801.jpg\" alt=\"\" width=\"383\" height=\"287\" align=\"Baseline\" border=\"0\" \/><\/div>\n<p>&nbsp;<\/p>\n<div align=\"justify\">\n<p>In the event&#8217;s script, the application uses an <span style=\"font-family: Courier New;\">IF <\/span>command to check the value returned by <i>Weekday <\/i>method, inserting then the values referring to the hourly programming (initial and final times) so that the tag&#8217;s value is altered:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Dim data, initialtime, finaltime, final, final2<\/span><br \/>\n<span style=\"font-family: Courier New;\">&#8216;Check if it is Sunday <\/span><br \/>\n<span style=\"font-family: Courier New;\">IF Weekday(Item(&#8220;DateTime&#8221;).Value) = 1 Then<\/span><br \/>\n<span style=\"font-family: Courier New;\">data = DateValue(now)<\/span><br \/>\n<span style=\"font-family: Courier New;\">initialtime = &#8220;12:00:00&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">finaltime = &#8220;12:01:00&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">final = data&#038;&#8221; &#8220;&#038; initialtime<\/span><br \/>\n<span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Data.TurnDeviceOn&#8221;).StartTime = final<\/span><br \/>\n<span style=\"font-family: Courier New;\">final2 = data&#038;&#8221; &#8220;&#038;horafinal<\/span><br \/>\n<span style=\"font-family: Courier New;\">Application.GetObject(&#8220;Data.TurnDeviceOff&#8221;).StartTime = final2<\/span><br \/>\n<span style=\"font-family: Courier New;\">End If<\/span><\/div>\n<p>Finally, the Timer tag&#8217;s <i>OnPreset <\/i>event contains the command scripts to change the tag&#8217;s value regarding the device. Example:<\/p>\n<p><span style=\"font-family: Courier New;\">Sub TurnDeviceOn_OnPreset()<br \/>\nParent.Item(&#8220;Device&#8221;).Value = TRUE<br \/>\nEnd Sub<\/span><\/p>\n<p><b>NOTE<\/b>: the demo application attached to this article was developed with Elipse E3 v4.0 build 225.<\/p>\n<h3>Attachments:<\/h3>\n<p><a href=\"\/wp-content\/uploads\/2019\/03\/Sample-8.zip\">Sample.zip<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Autor<br \/>\nGuilherme Torres<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[733],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-57412: Demo application - KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:] - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.\" \/>\n<meta property=\"og:description\" content=\"Autor Guilherme Torres\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:43:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-05T20:21:08+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4857\/KB-4801.jpg\" \/>\n<meta name=\"author\" content=\"Elipse Software\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Elipse Software\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/\"},\"author\":{\"name\":\"Elipse Software\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\"},\"headline\":\"KB-57412: Demo application &#8211; Hourly programming to turn the device on\/off from a day of the week.\",\"datePublished\":\"2019-03-25T20:43:02+00:00\",\"dateModified\":\"2019-07-05T20:21:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/\"},\"wordCount\":485,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Demo Application\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/\",\"name\":\"[:pt]KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:en]KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:43:02+00:00\",\"dateModified\":\"2019-07-05T20:21:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-57412: Demo application &#8211; Hourly programming to turn the device on\/off from a day of the week.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\",\"name\":\"Elipse Software\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"caption\":\"Elipse Software\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-57412: Demo application - KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:] - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:en]KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:] - Elipse Knowledgebase","og_description":"[:pt]Autor Guilherme Torres[:en]Autor Guilherme Torres[:]","og_url":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:43:02+00:00","article_modified_time":"2019-07-05T20:21:08+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4857\/KB-4801.jpg"}],"author":"Elipse Software","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Elipse Software","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/"},"author":{"name":"Elipse Software","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87"},"headline":"KB-57412: Demo application &#8211; Hourly programming to turn the device on\/off from a day of the week.","datePublished":"2019-03-25T20:43:02+00:00","dateModified":"2019-07-05T20:21:08+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/"},"wordCount":485,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Demo Application"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/","url":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/","name":"[:pt]KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:en]KB-57412: Demo application - Hourly programming to turn the device on\/off from a day of the week.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:43:02+00:00","dateModified":"2019-07-05T20:21:08+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb57412-demo-application-hourly-programming-to-turn-the-device-onoff-from-a-day-of-the-week\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-57412: Demo application &#8211; Hourly programming to turn the device on\/off from a day of the week."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87","name":"Elipse Software","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","caption":"Elipse Software"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3172"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=3172"}],"version-history":[{"count":4,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3172\/revisions"}],"predecessor-version":[{"id":7748,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3172\/revisions\/7748"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=3172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=3172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=3172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}