Results 1 to 5 of 5

Thread: Virtual outlets for weekday/weekend, what am I missing?

  1. #1
    Regular Vistor
    Join Date
    Sep 2014
    Location
    Peoria, IL
    Posts
    30

    Virtual outlets for weekday/weekend, what am I missing?

    Here is my program for virtual outlets:

    Schedule expected:
    Weekdays: Turn ON between 03:30PM and 10:30PM
    Week end: Turn ON between 10:30AM and 03:30PM

    weekday virtual
    Code:
    fl_weekday
    If Time 15:30 to 22:30 Then ON
    If DoW S-----S Then OFF
    weekend virtual
    Code:
    fl_weekend
    If Time 10:30 to 15:30 Then ON
    If DoW -MTWTF- Then OFF
    And the physical outlet:
    Code:
    LightFront
    Fallback OFF
    Set OFF
    If Output fl_weekday = ON Then ON
    If Output fl_weekend = ON Then ON
    If Tmp > 82.0 Then OFF
    Min Time 010:00 Then OFF
    But it seems to not be working. What am I missing?

    Thanks!

  2. #2
    Master Control Freak RussM's Avatar
    Join Date
    Dec 2012
    Location
    California - US Pacific
    Posts
    22,488
    You need a Set OFF statement above the If Time statement in both virtual outputs.
    Please do not send me PMs with technical questions or requesting assistance - use the forums for Apex help. PM me ONLY if the matter is of a private or personal nature. Thanks.

  3. #3
    Regular Vistor
    Join Date
    Sep 2014
    Location
    Peoria, IL
    Posts
    30
    Quote Originally Posted by RussM View Post
    You need a Set OFF statement above the If Time statement in both virtual outputs.
    Thank you for your time! That seems to not be working either. This is the example from the Reference guide I followed:

    Capture.PNG

  4. #4
    Frequent Contributor SuncrestReef's Avatar
    Join Date
    Feb 2018
    Location
    Beaverton, OR
    Posts
    3,105
    Russ is correct in saying you need a Set Off on your virtual outlets. Think of it this way...

    fl_weekday
    If Time 15:30 to 22:30 Then ON
    If DoW S-----S Then OFF

    1. Let's say today is Monday, at 12:00 noon. Your virtual outlet will be Off because the code turned it off yesterday (since Sunday = Off).

    2. Now as the time passes 15:30, the virtual outlet turns on.

    3. Next, the time passes 22:30. What turns the outlet off? Answer: NOTHING. It won't turn off again until Saturday because that's the next time an OFF statement is true.

  5. #5
    Regular Vistor
    Join Date
    Sep 2014
    Location
    Peoria, IL
    Posts
    30
    Quote Originally Posted by SuncrestReef View Post
    Russ is correct in saying you need a Set Off on your virtual outlets. Think of it this way...
    fl_weekday
    If Time 15:30 to 22:30 Then ON
    If DoW S-----S Then OFF

    1. Let's say today is Monday, at 12:00 noon. Your virtual outlet will be Off because the code turned it off yesterday (since Sunday = Off).

    2. Now as the time passes 15:30, the virtual outlet turns on.

    3. Next, the time passes 22:30. What turns the outlet off? Answer: NOTHING. It won't turn off again until Saturday because that's the next time an OFF statement is true.
    Quote Originally Posted by RussM View Post
    You need a Set OFF statement above the If Time statement in both virtual outputs.

    Thank you guys for your time and replies. I tried your way as well but for some reason the schedule didn't work. I rebooted the controller to see if it made a difference, and it looks like the reboot fixed the issue. There might have been something preventing the schedule from working like it should and the reboot must have shaken something loose.

Similar Threads

  1. Question: AFS program, weekday vs weekend issue
    By sdivers in forum Misc Apex Usage & Programming
    Replies: 0
    Last Post: 09-21-2016, 08:28
  2. Question: What are my virtual outlets doing?
    By Wheeler89 in forum Misc Apex Usage & Programming
    Replies: 5
    Last Post: 03-08-2015, 19:15
  3. How do I add a virtual EB8 for virtual outlets?
    By kirk_m in forum Apex Classic/Apex Lite/Apex Jr
    Replies: 1
    Last Post: 07-09-2014, 16:59
  4. Virtual Outlets
    By USA Reefer in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 4
    Last Post: 04-26-2013, 17:48
  5. Replies: 5
    Last Post: 03-16-2013, 20:15

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •