Results 1 to 5 of 5

Thread: Found an interesting bug: switch with "Feed" in name won't upload

  1. #1
    New User
    Join Date
    Feb 2018
    Location
    US, Mountain Time
    Posts
    6

    Found an interesting bug: switch with "Feed" in name won't upload

    I've setup a momentary push button to allow family members to easily set feed mode. Initially, I named the digital switch "FeedSw". I then created a virtual outlet named "FeedVO" to register the button push and hold the feed mode open for 5 min.

    Now, here's the interesting part. Everytime I upload the following code to FeedVO:

    Fallback OFF
    Set OFF
    If FeedSw CLOSED Then ON
    Min Time 005:00 Then ON

    It would revert to the following, like clockwork:

    Fallback OFF
    Set OFF
    If FeedA 000 Then ON
    Min Time 005:00 Then ON

    It repeatedly replaced my "If FeedSw CLOSED Then ON" with "If FeedA 000 Then ON". This was repeatable using either the web interface or apex.local, and I went nuts trying to debug this. Finally, I renamed "FeedSw" to "Sw_Fd" and it worked just fine. Here's the final code:

    Fallback OFF
    Set OFF
    If Sw_Fd CLOSED Then ON
    Min Time 005:00 Then ON

    Such a strange bug! Figured I mention it here in case anyone else comes across this issue.

  2. #2
    Regular Vistor
    Join Date
    Jan 2015
    Location
    USA
    Posts
    24
    That sounds more like a reserved word for programming than a bug. Having names that closely match instructions/programming syntax is bad idea since it leads to confusion.

  3. #3
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by idpitt View Post
    That sounds more like a reserved word for programming than a bug. Having names that closely match instructions/programming syntax is bad idea since it leads to confusion.
    This ^. This behavior has been known to occur for years.

    You might be an engineer if...You have no life and can prove it mathematically.

  4. #4
    Frequent Visitor Todd's Avatar
    Join Date
    Jan 2013
    Location
    Huntsville, AL
    Posts
    583
    I seem to recall it occurs if the reserved word is at the beginning. So Feed_VO will cause a problem, but VO_Feed won't.

  5. #5
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by Todd View Post
    I seem to recall it occurs if the reserved word is at the beginning. So Feed_VO will cause a problem, but VO_Feed won't.
    This is correct

    You might be an engineer if...You have no life and can prove it mathematically.

Similar Threads

  1. Program a switch to change a output from "auto" to "off"
    By saltaholic in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 4
    Last Post: 07-30-2018, 21:36
  2. apex lite weird switch problem"""
    By saltdiscus in forum AquaBus Modules, Probes, and Breakout Boxes
    Replies: 2
    Last Post: 06-29-2015, 05:36
  3. apex lite weird switch problem"""
    By saltdiscus in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 2
    Last Post: 06-29-2015, 05:36
  4. loop "Found ARP entry"
    By cyclist in forum Updating Apex Classic Firmware & Web Pages
    Replies: 4
    Last Post: 08-07-2014, 20:29
  5. Help! getting "404 not found" error
    By bucfan in forum Networking & Internet Connectivity
    Replies: 23
    Last Post: 04-22-2013, 06:57

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
  •