Ctouch B+W Mk2 Logic Issue

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by chromus, Aug 29, 2019.

  1. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    Hi All,

    I recently did some major updates to my Ctouch config and now I have an issue with temp module readouts displaying.

    Hopefully @NickD, @daniel or some other logic enlightened peeps can shed some light on this.

    Basically the Ctouch isn't displaying the temps anymore from my sensor module.

    I suspect it's something to do with PICED uploading the code rather than the logic code itself but I have included the code anyway, no changes were made to the logic at all during this update I was merely adding a few new lights. It is based on @bmerrick s code found here http://www.cbusforums.com/forums/showthread.php?t=11779

    The PICED WYSIWYG when connected to the CBUS network displays the temps which I know are working as I have them in my EDLTs too, but the real unit doesn't. See the 3screens.jpg attached.

    System IO manager and measurement manager screenshots are attached too 3screens.jpg systemiomanager.JPG measurementmanager.JPG
    Code:
    Global Variables
    // {Enter Variable definitions here}
    
    // *** Temperature Extraction Logic ***
    // Pool Temp
    r_ptemp : real;
    s_ptemp : string;
    
    // Tank Temp
    r_ttemp : real;
    s_ttemp : string;
    
    // Cellar Temp
    r_ctemp : real;
    s_ctemp : string;
    
    // Roof Temp
    r_rtemp : real;
    s_rtemp : string;
    
    Code:
    Module
     "Temp Management"
    // Code from http://www.cbusforums.com/forums/showthread.php?t=11779
    
    once (Second = 59) then // IMPORTANT - don't run this code every cycle - once a minute is ample
      begin
        //Pool
        r_ptemp := GetRealIBSystemIO("Measurement App Real Value", 254, 1, 1);
        Format(s_ptemp, r_ptemp:2:1);
        Append(s_ptemp, ' C');
        SetStringSystemIO("Pool Temp Display", s_ptemp);
        //End Pool
       
        //Roof
        r_rtemp := GetRealIBSystemIO("Measurement App Real Value", 254, 1, 2);
        Format(s_rtemp, r_rtemp:2:1);
        Append(s_rtemp, ' C');
        SetStringSystemIO("Roof Temp Display", s_rtemp);
        //End Roof
    
        //Cellar
        r_ctemp := GetRealIBSystemIO("Measurement App Real Value", 254, 1, 3);
        Format(s_ctemp, r_ctemp:2:1);
        Append(s_ctemp, ' C');
        SetStringSystemIO("Cellar Temp Display", s_ctemp);
        //End Cellar
    
        //Tank
        r_ttemp := GetRealIBSystemIO("Measurement App Real Value", 254, 1, 4);
        Format(s_ttemp, r_ttemp:2:1);
        Append(s_ttemp, ' C');
        SetStringSystemIO("Tank Temp Display", s_ttemp);
        //If s_ttemp > 27.0 then SetCBusLevel(254, Ligting, Cellar, On, 1);
        //SetCBusLevel(Network, Application, GroupAddress, NewLevel, RampRate);
        //End Tank
       
      end;
    
     
    chromus, Aug 29, 2019
    #1
    1. Advertisements

  2. chromus

    bmerrick

    Joined:
    Jun 13, 2007
    Messages:
    372
    Likes Received:
    12
    Location:
    Sydney
    Hi Chromus,

    Your logic looks fine as you show it works on the PICED PC simulation and you say it used to work on the C-Touch screen itself. Sorry I can't help more directly with your issue as I haven't seen this issue you are seeing before.

    To me it looks like the logic engine isn't enabled (or has crashed) in the C-Touch, this is unusual. It could also have perhaps have happened during a firmware upgrade from a later version of PICED?

    I don't want to teach you to suck eggs as you obviously have done a lot with your C-Touch before, but I would be trying to find out if the logic is running in it at all by doing a few diags for example: (I assume the C-Bus light 'buttons' etc on it work)

    1. Under 'Project Details' on Project menu, hitting back a few times to ensure you have the right C-Touch selected. There are original C-Touch, V2s and Spectrums there with and without logic engines, perhaps the wrong one has selected due to a project file corruption etc. Also check the C-Bus Unit Address and other details are still correct on the 'C-Bus' tab (in case its been moved on the network).

    2. Perhaps the logic crashed before/due to the C-Bus not being online when the logic first ran at 59 secs. Under 'Logic Options' in the Logic Programming section, you can enable 'Auto Restart Logic following an Error' and can also try 'Wait until C-Bus is on-line to start logic'

    3. Under the "Transfer' Menu, the Resource Report. Does it show memory allocated to 'Logic' in the list. Assume the Spare Memory is not 0 is it?

    4. Writing a small logic routine to ramp a light on and off as see if that goes.

    Code:
    once (Second = 59) then 
      begin
    SetLightingLevel("KitchenDL", 100%, "4s");
      end;
      once (Second = 29) then 
      begin
    SetLightingLevel("KitchenDL", 0%, "4s");
      end;
    
    Hope this is some help if you haven't tried already yourself. Good Luck.

    Brad
     
    bmerrick, Sep 2, 2019
    #2
    chromus likes this.
    1. Advertisements

  3. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    Thanks for your input Brad,

    I do have some schedules driven by the screen so I assume the logic is running based on that?

    I will give the module u included above a go over the next day or so and go from there.

    In the Ctouch Mk2 "Wait Untill CBUS is online" is always on, but I ticked the box anyway

    I have enabled the "restart on error" ready for upload with your test module.

    Here is the resources report:
    Code:
    Logic                                                  4612
    
    Power Meters (0)                                          0
    Zip File                                              11569
    -----------------------------------------------------------
    Total Configuration Memory Used                       96768
    Spare Memory                                         165375
    Total Unit Memory                                    262144
    
    -----------------------------------------------------------
    
    SUMMARY
    
    Components                                            21.3%
    Fonts                                                  7.6%
    Schedules                                              0.7%
    Scenes                                                 0.2%
    Special Days                                           0.1%
    Monitors                                               0.0%
    Power Meters                                           0.0%
    System IO                                              0.1%
    Logic                                                  1.8%
    Other                                                  5.2%
    Spare                                                 63.1%
    
    ===========================================================
    
    USER SETTINGS MEMORY
    
    Item                                              Memory (bytes)
    
    C-Bus Groups                                           2560
    Misc                                                    256
    Scenes                                                   35
    Schedules                                               494
    System IO                                               316
    Passwords                                                12
    Special Days                                              0
    Power Meters                                              0
    Spare                                                 29095
    
     
    chromus, Sep 2, 2019
    #3
  4. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    Looks like the module may be stuffed. Its dropped channels 1 and 3 for no apparent reason. I was also getting a PCI mode warning when connecting to it.

    I will put this on hold till I get a new module and go from there.
     
    chromus, Sep 6, 2019
    #4
  5. chromus

    Wonkey

    Joined:
    Aug 3, 2004
    Messages:
    169
    Likes Received:
    12
    Location:
    Adelaide
    Just try down powering it and re-powering it after 20 or 30 secs had this issue myself.
    Colin
     
    Wonkey, Sep 6, 2019
    #5
    chromus likes this.
  6. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    I'll give that a shot thanks @Wonkey
     
    chromus, Sep 11, 2019
    #6
  7. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    Hi @Wonkey - I left the unit unplugged all night and still only channels 2 and 4 working, ordered 2 more DTSI5104's and Im gonna have some fun automating the sweep fans and a bunch of other stuff "because I can" :D This will also once and for all determine if its the old unit or my code/screen.
     
    chromus, Sep 13, 2019
    #7
  8. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    @bmerrick - I got time to add that logic module you suggested and it runs reliably so at this point I think it's safe to say the logic engine is running and the DTSI5104 is fookt.

    New modules should be here in a week so I will go from there.
     
    chromus, Sep 13, 2019
    #8
  9. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    For those who have been following, looks like this was the early symptoms of a dying DTSI5104.

    I swapped it out today with a replacement and it all worked with no intervention.

    It seems like the data from the unit was still in a format that was acceptable to my eDLTs but not to the logic engine.

    @NickD (or any other Clipsal poster) any reason that might be?

    Thanks to @bmerrick and @Wonkey for taking the time to reply.
     
    chromus, Sep 16, 2019
    #9
  10. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    Last note: my wife commented this morning "oh the pool and fishtank temps are back on my phone app".

    I don't use the wiser, I use a Homekit interface but she can't due to her works silly IT policies. She hadn't told me it was all broken, but it certainly now looks like whatever the old DTSI5104 was broadcasting was not in a format the logic engine in the screen and for wiser liked, but for some reason the eDLTs were more tolerant of the issue.
     
    chromus, Sep 17, 2019
    #10
  11. chromus

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,394
    Likes Received:
    35
    Location:
    Adelaide
    My guess is that somehow the "Local SAL" mode in the DTSI has been cleared.

    I've seen this once before myself, and now I've seen it a second time I'm wondering if it's a firmware defect in the unit, or whether Toolkit is changing a setting it shouldn't. I'll raise a ticket to look into it.

    In the meantime, if this is the case, you can correct it with the Diagnostic Utility.

    Use the C-Bus->Set Mode of Other PCI option. It will complain that it's not a PCI (but it really is, it's just in disguise).

    Then if the "Local SAL" box is not ticked, that's your problem, so tick it, and click OK, and it should start working.

    Nick
     
    NickD, Sep 19, 2019
    #11
  12. chromus

    Wonkey

    Joined:
    Aug 3, 2004
    Messages:
    169
    Likes Received:
    12
    Location:
    Adelaide
    Note that Diagnostic Utility in C-Bus->Set Mode of Other PCI will require the unit address in Hexadecimal
    Colin
     
    Wonkey, Sep 19, 2019
    #12
  13. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    OK ->

    I just got a few mins to re install the old unit into the network and add a sensor to it for testing.

    To avoid confusion, working unit is on address 10 (Hex0A) and "broken" unit is on address 9 (Hex09)

    The SAL was infact disabled and I have enabled it, I can see it broadcasting the temp in the diagnostic tool and can see the temp in the ToolKit dialog but still nothing coming thru to the screen. Which is unsurprising as the measurement Application manager is showing no data.

    See attached screenshots

    TempSALMode.JPG TempPICED.JPG
     
    chromus, Sep 26, 2019
    #13
  14. chromus

    Wonkey

    Joined:
    Aug 3, 2004
    Messages:
    169
    Likes Received:
    12
    Location:
    Adelaide
    Did you notice that the device you highlighted is declaring it is device 1 not 0.
    Colin
     
    Wonkey, Oct 7, 2019
    #14
  15. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    94
    Likes Received:
    9
    Location:
    Perth
    I did fix that and retested, the original unit is still knackered, channels 2 and 4 work intermittently but 1 and 3 are completely fooked.

    The unit is drawing way more than the nominal rated milliamps too so this is pointing to a short somewhere. :(

    The new units I got work, I need some spare time to install and commission them to automatically run the sweep fans and re-enable the auto retracting roof and fish tank temp management. It's a shame clipsal charges so much for DS18b20's in a clipsal box that aren't fully weather proof, making up my own is 1/10th the price and they are 316SS and enamel coated.
     
    chromus, Oct 14, 2019
    #15
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.