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:
    70
    Likes Received:
    2
    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:
    368
    Likes Received:
    9
    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:
    70
    Likes Received:
    2
    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:
    70
    Likes Received:
    2
    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:
    145
    Likes Received:
    7
    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:
    70
    Likes Received:
    2
    Location:
    Perth
    I'll give that a shot thanks @Wonkey
     
    chromus, Sep 11, 2019 at 4:22 AM
    #6
  7. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    70
    Likes Received:
    2
    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 at 3:40 AM
    #7
  8. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    70
    Likes Received:
    2
    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 at 12:54 PM
    #8
    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.