DLT Labels In Logic

Discussion in 'General Discussion' started by chrisd4021, Sep 5, 2011.

  1. chrisd4021

    chrisd4021

    Joined:
    May 12, 2011
    Messages:
    44
    Likes Received:
    0
    Location:
    South Yorkshire
    Hi Guys,

    I know this question has been asked many times in different variants and please be gentle as I'm just trying to learn logic, I've read the logic/help/labels section and this is what I end up with.

    All I want to do is change the label depending on the state of ("Away Schedule Trigger") I've tried the DLT on variant 1 and 2 and also read that you need to have the language set to english in the initialsation as below.

    SetIntIBSystemIO("Label Language", 1);

    In the modules I have this:-

    Once (GetLightingState("Away Schedule Trigger") = ON) then
    begin

    SetStringIBSystemIO("Label Group Text", 254, 56, 22, 0, 'Manual');

    if (GetLightingState("Away Schedule Trigger") = OFF) then

    SetStringIBSystemIO("Label Group Text", 254, 56, 22, 0, 'Automatic');

    end;

    All I get is BUTTON 5 displayed

    Any Help would be appreciated
     
    chrisd4021, Sep 5, 2011
    #1
  2. chrisd4021

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I personally have never found it necesasry to specify the default language that the logic engine is using, as it defaults to English. If the language you've specified for your network using Toolkit is the default, English, then there's no need to initialise it in the logic engine. If you've used a different language to the default in Toolkit, then you'll need to initialise it in logic. Note that C-Bus treats English, English(UK), English(USA), etc all as unique languages.

    I take it the group you want to label is group number 22 (decimal)? I always find it easier to use the group tags rather than try and correlate what group address means what. Instead of the number 22 in your logic you can use "Group Name" (including quotes).

    If all you're trying to do is change the name for a particular group then there's no need to use variants. Make sure that the DLT is set to use Variant 1 for all it's keys.

    Your last logic condition uses an "If" statement. This statement will be true for many passes of the logic engine, so the logic engine will try and transmit the label into the network many, many times. This may be where things are going wrong. I suggest you change this to a "Once" statement.

    With all things that don't result in the desired behaviour, it's best to connect to C-Bus using the Diagnostic Utility and take a look at what's actually going onto the bus. This may point out an issue with the specified language, labels being sent repeatedly, labels on the wrong group, etc.
     
    Newman, Sep 5, 2011
    #2
  3. chrisd4021

    Dave Byron

    Joined:
    Aug 3, 2004
    Messages:
    835
    Likes Received:
    0
    Location:
    Casurina
    The logic not correct - the Away Schedule Trigger") = OFF) is unlikely to get run as the whole logic only runs when the Away Schedule Trigger") = ON) is first true.

    This would work
    Once (GetLightingState("Away Schedule Trigger") = ON) then
    SetStringIBSystemIO("Label Group Text", 254, 56, 22, 0, 'Manual');

    once (GetLightingState("Away Schedule Trigger") = OFF) then
    SetStringIBSystemIO("Label Group Text", 254, 56, 22, 0, 'Automatic');

    And make sure the DLT has the correct language set via Toolkit.

    dave
     
    Last edited by a moderator: Sep 6, 2011
    Dave Byron, Sep 6, 2011
    #3
  4. chrisd4021

    chrisd4021

    Joined:
    May 12, 2011
    Messages:
    44
    Likes Received:
    0
    Location:
    South Yorkshire
    Thanks Guys,

    Changed the logic to

    Once (GetLightingState("Away Schedule Trigger") = ON) then
    SetStringIBSystemIO("Label Group Text", 254, 56,"Away Schedule Trigger" , 0, 'Manual');

    once (GetLightingState("Away Schedule Trigger") = OFF) then
    SetStringIBSystemIO("Label Group Text", 254, 56,"Away Schedule Trigger", 0, 'Automatic');

    and the DLT is set as attached

    Does the DLT label within the DLT itself have to be set to default? I understand It needs to be Variant 1 but will the logic override any previous text? Because if It;s set to default then the label just reads Away Schedu and as normal if this is changed to something more unique Automatic it stays at that label dispite the logic above running.

    One other thing the away schedule button is on 2 DLT's both set the same which I assume would'nt cause any issue?

    Thanks in advance for your help
     

    Attached Files:

    • Dlt.JPG
      Dlt.JPG
      File size:
      85.3 KB
      Views:
      669
    chrisd4021, Sep 6, 2011
    #4
  5. chrisd4021

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    In the screenshot posted you have the checkbox ticked titled "Block Dynamic Updates". This means that the DLT will ignore any C-Bus messages that try to change it's label. This needs to be un-ticked and saved to the unit.

    There's no issue having mutliple DLT's on the same Group Address. They'll both update together (once you un-check the box above).
     
    Newman, Sep 6, 2011
    #5
  6. chrisd4021

    chrisd4021

    Joined:
    May 12, 2011
    Messages:
    44
    Likes Received:
    0
    Location:
    South Yorkshire
    Hi,

    I,ve unticked the dynamic labels on both DLT's and still not change, Had a look at the Cbus Diagnostic Utility which give this output when switching the (Away Schedule trigger) Off then On

    18:38:11 Rx : 0511380001169B<CR>
    18:38:11 Rx : = GA 22 Off
    18:38:12 Rx : 05113800791623<CR>
    18:38:12 Rx : = GA 22 On

    The only part of that I understand is the time, and the address of the (Away Schedule trigger)(22). I guess within that transmission you should see somthing relating to a logic command?

    Chris
     
    chrisd4021, Sep 6, 2011
    #6
  7. chrisd4021

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The log details you've provided above show that the label messages are not being sent out of the unit that is running your logic, so that is the area that you need to investigate.
     
    Newman, Sep 6, 2011
    #7
  8. chrisd4021

    UK Household Automation

    Joined:
    Aug 6, 2004
    Messages:
    105
    Likes Received:
    0
    Similar problem to this thread

    Hi folks,
    I have a client who has some patio lights which he wants to control with a single DLT button in a scene cycle thus....

    Press..............patio lights on,
    Press again....patio lights off,
    Press again....patio lights are switched off but are now controlled by an external PIR,
    Press again....patio lights on,
    Press again....patio lights off,
    ...........etc...............
    ..........etc................

    The scenes are stored in a Colour C-Touch Mk2, and are these...

    Test Scene 106= Lights Off, PIR connected (Automatic),
    Test Scene 107= Lights On, PIR disconnected (ON),
    Test Scene 108= Lights Off, PIR disconnected (OFF).

    I think I have this setup functioning ok according to the graphical representations on my PC but I can't work out how to change the DLT labels to reflect the current state.
    By looking through the forums and help/tutorials I managed to steal & adjust the following logic:

    once GetLightingState("Scene Cycle Patio") then
    begin
    if SceneIsSet("Test Scene 106") then
    SetScene("Test Scene 107")
    SetStringIBSystemIO("Label Group Text", 254, 56, 100, 0,'Patio ON')
    else if SceneIsSet("Test Scene 107") then
    SetScene("Test Scene 108")
    SetStringIBSystemIO("Label Group Text", 254, 56, 100, 0, 'Patio OFF')
    else if SceneIsSet("Test Scene 107") then
    SetScene("Test Scene 106")
    SetStringIBSystemIO("Label Group Text",254,56,100, 0, 'Patio Auto')
    end;


    When I come to compile it I get the following errors...

    Error C006 at line 30:5 - Illegal symbol
    Error C261 at line 30:25 - Tag Error
    Error C006 at line 33:5 - Illegal symbol
    Error C261 at line 33:25 - Tag Error
    Error C006 at line 36:5 - Illegal symbol
    Error C261 at line 36:25 - Tag Error


    What's the Illegal symbol?
    Why am I getting a Tag Error?
    What am I missing?
    Who really killed JFK?

    Also, I note that there may be a finite number of 'writes' permitted for the DLTs so should I even be considerring this?

    Ta Very Muchly
     
    Last edited by a moderator: Oct 4, 2011
    UK Household Automation, Oct 4, 2011
    #8
  9. chrisd4021

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    I think you need a few more begin/end pairs in your inner if statements :
    Code:
    once GetLightingState("Scene Cycle Patio") then
      begin
        if SceneIsSet("Test Scene 106") then
          begin    
            SetScene("Test Scene 107")
            SetStringIBSystemIO("Label Group Text", 254, 56, 100, 0,'Patio ON')
          end
        else if SceneIsSet("Test Scene 107") then
          begin    
            SetScene("Test Scene 108")
            SetStringIBSystemIO("Label Group Text", 254, 56, 100, 0, 'Patio OFF')
          end
       else if SceneIsSet("Test Scene 107") then
         begin
           SetScene("Test Scene 106")
           SetStringIBSystemIO("Label Group Text",254,56,100, 0, 'Patio Auto')
         end
    end;
    
    As for the finite number of write cycles, you should be ok.

    Given it's a scene cycle function, if you want to cycle through several scenes to find the one you want you will end up sending the labels for all the intermediate steps, every time... you could improve it with a little more code to wait until the cycling has stopped before sending the label. This of course assumes the user is looking at the lights to work out when to stop and not waiting for the labels.

    Nick

    Nick
     
    NickD, Oct 5, 2011
    #9
  10. chrisd4021

    Dave Byron

    Joined:
    Aug 3, 2004
    Messages:
    835
    Likes Received:
    0
    Location:
    Casurina
    The line - and in nicks needs;

    SetScene("Test Scene 107");

    at the end of the line

    and the
    Error C261 at line 30:25 - Tag Error

    means the tag name not found in the database - checking spelling

    dave
     
    Dave Byron, Oct 5, 2011
    #10
  11. chrisd4021

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    If you double click on the error message it will take you to the exact point of the error. It will hopefully be apparent what the problem is then.

    Good question, but probably the wrong forum for that one ;)
     
    Darren, Oct 5, 2011
    #11
  12. chrisd4021

    UK Household Automation

    Joined:
    Aug 6, 2004
    Messages:
    105
    Likes Received:
    0
    Thank you all, We'll try it all out ASAP.
     
    UK Household Automation, Oct 5, 2011
    #12
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.