5031rdtsl

Discussion in 'General Discussion' started by Aaron, Jul 24, 2010.

  1. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Hello,

    I would like to use the 5031RDTSL unit for zone control of a heating system.
    I have a MkII B&W screen *with logic*.
    do you have any leads as to some typical set ups for the use of this unit.
    I've looked at some of the heating control applications and all this makes sense, but am having some trouble getting the zone temp to work correctly with the code?
    I can display/monitor the unit fine?

    Any help/advice much appreciated, Aaron

    This is my (very basic) code;

    Code:
    SetPoint := GetCBusLevel("LOCAL", "Heating (Legacy)", "Bed 1 Set Point");
    RoomTemp := GetCBusLevel("LOCAL", "Temperature Broadcast", "Bed1 Rm Temp");
    
    
    
    
    
    
    
    if (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = ON) 
    then begin
       if (RoomTemp > SetPoint) then
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
       if (RoomTemp < SetPoint) then
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", ON);
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", ON);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = OFF) 
    then begin
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    end
    
     
    Aaron, Jul 24, 2010
    #1
  2. Aaron

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Is this a statement or a question? I assume you are saying you can actually see the correct temperature.

    There are several problems with the code.

    The code:
    Code:
       if (RoomTemp > SetPoint) then
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
           SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    will switch BED 1 EXT RAD off when RoomTem > SetPoint (which I assume is what you want), but it also switches off BED 1 INT RAD every time the logic runs (which is probably not what you want).

    I think that what you intended was:
    Code:
    if (RoomTemp > SetPoint) then
    begin
        SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
        SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    end;
    
    The second problem is that the heaters are being switched every scan (5 times per second) which will flood C-Bus with messages and cause the logic engine to raise an error. There are several ways of addressing this, including using "once" statements. Here is one way to fix this:

    Code:
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = ON) and (RoomTemp > SetPoint) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = ON) and (RoomTemp < SetPoint) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", ON);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", ON);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = OFF) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    end
    
    The third problem is that there is no "hysteresis" included. This means that when the temperature gets close to the set point, the heaters will switch off and on a lot. To add +/- 0.5 degree of hysteresis:


    Code:
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = ON) and (RoomTemp > SetPoint + 0.5) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = ON) and (RoomTemp < SetPoint - 0.5) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", ON);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", ON);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = OFF) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    end
    

    The final thing you could do to improve the code is to combine the two places where the heating gets switched off:

    Code:
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = OFF) or
         (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = ON) and (RoomTemp > SetPoint + 0.5) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "HEATING SWITCH") = ON) and (RoomTemp < SetPoint - 0.5) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", ON);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", ON);
    end;
    
    See the logic example project called "temp control" for a complete solution.
     
    Darren, Jul 25, 2010
    #2
  3. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Thanks

    :)

    Thanks very very very much:D

    The only other problem I was having is that when running my original code, assuming the room temp (from the 5031RDTSL) is displaying approx 20 deg C (as a monitor in the B&W screen) then I have to lower the set-point temp to 16 deg C (and the code switched around this point)

    I've obviously done something wrong.
    Could it be something to do with the variables declared etc???

    Code:
    {Enter Variable definitions here}
    SetPoint, FloorTemp, RoomTemp : real;
    
    I is very knew to this code stuff (as I'm sure you can tell!):D
     
    Aaron, Jul 25, 2010
    #3
  4. Aaron

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You are welcome.

    I would suggest ignoring any odd symptoms from the original code and test with the new code. If the problem still exists, then we can look into it further then.
     
    Darren, Jul 26, 2010
    #4
  5. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Hello again,

    finally picking this up . . . .

    I've used your code and I have two problems;


    The 'BOILER START' output only seems to switch when the
    'BED 1 HEATING SWITCH' is switched and not by the RoomTemp/SetPoint?

    Also, when adjusting the SetPoint up/down to make the desired output switch about the current RoomTemp it always seems to switch approx 6 deg C from where I would expect(about the SetPoint), even when I heated up the room sensor (5031rdtsl)

    where have I gone wrong?


    These are my global variables;
    Code:
    {Enter Variable definitions here}
    SetPoint, FloorTemp, RoomTemp : real;
    
    Code:
    SetPoint := GetCBusLevel("LOCAL", "Heating (Legacy)", "Bed 1 Set Point");
    RoomTemp := GetCBusLevel("LOCAL", "Temperature Broadcast", "Bed1 Rm Temp");
    
    
    
    once (GetCBusState("LOCAL", "Heating (Legacy)", "BED 1 HEATING SWITCH") = OFF) or
         (GetCBusState("LOCAL", "Heating (Legacy)", "BED 1 HEATING SWITCH") = ON) and (RoomTemp > SetPoint + 1.0) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BOILER START", OFF);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "BED 1 HEATING SWITCH") = ON) and (RoomTemp < SetPoint - 1.0) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", ON);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", ON);
       SetCBusState("LOCAL", "Heating (Legacy)", "BOILER START", ON);
    end;
    
     
    Aaron, Jan 11, 2011
    #5
  6. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Any help much appreciated?

     
    Aaron, Jan 14, 2011
    #6
  7. Aaron

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    By the look of it you need an extra set of brackets in your first condition statement.

    Code:
    SetPoint := GetCBusLevel("LOCAL", "Heating (Legacy)", "Bed 1 Set Point");
    RoomTemp := GetCBusLevel("LOCAL", "Temperature Broadcast", "Bed1 Rm Temp");
    
    
    
    once (GetCBusState("LOCAL", "Heating (Legacy)", "BED 1 HEATING SWITCH") = OFF) or
         ((GetCBusState("LOCAL", "Heating (Legacy)", "BED 1 HEATING SWITCH") = ON) and (RoomTemp > SetPoint + 1.0)) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", OFF);
       SetCBusState("LOCAL", "Heating (Legacy)", "BOILER START", OFF);
    end;
    once (GetCBusState("LOCAL", "Heating (Legacy)", "BED 1 HEATING SWITCH") = ON) and (RoomTemp < SetPoint - 1.0) then 
    begin
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 EXT RAD", ON);
       SetCBusState("LOCAL", "Heating (Legacy)", "BED 1 INT RAD", ON);
       SetCBusState("LOCAL", "Heating (Legacy)", "BOILER START", ON);
    end;
    If you still have issues regarding the temperature switching after this, it may depend upon how you've got the temperature sensor programmed. It looks like you've got it programmed in '6031TS' mode. If you look on the Global tab you can change the message broadcast rate and a value of change that will trigger an immediate temperature broadcast.

    Mounting sensors high or low in a room can have a big impact too, which can be compensated for to some extent with the Temperature Offset feature.
     
    Newman, Jan 14, 2011
    #7
  8. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Hi All,

    I,m still having problems with this??

    I've set the sensor up as a 6031.

    If I heat the sensor up, the switching point always seems to be approx 4-5 deg C below sensor value (I'm expecting it to operate within dead band range?).

    I've tried correcting with offset feature but this just artificially elevates the room temp, but still the 4-5 deg difference.

    All the temperatures seem to display correctly?

    Also, for some reason the BOILER START command is only operating with the HEATING SWITCH??

    I have multiple rooms where once I get the code working, I need to cut and paste etc... What is the best way to switch the one BOILER START when multiple rooms may be trying to enable/disable it?

    Aaron
     
    Aaron, Jan 25, 2011
    #8
  9. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Anyone able to help??:D

    Do you need more info from me?
     
    Aaron, Jan 26, 2011
    #9
  10. Aaron

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Where do you define the level of the "Bed 1 Set Point" group address? The level of this group is not being set by either the unit or logic so you must be setting this somewhere.

    Any differences in the maths between how you're mapping the group address level to a temperature value, compared with how the temperature sensor does it, will cause problems. Have you actually worked out what group address levels correspond with what temperatures for the temperature sensor? Do the values coming from the temperature sensor match what you're expecting to get? When the temperature is 20 degrees, what is the level of the "Bed1 Rm Temp", as set by the temperature sensor?

    There should be no need to use the offset feature in the temperature sensor unless the temperature you actually measure in the room (with a thermometer or similar) is different to what the temperature sensor is telling you in Toolkit.

    You're going to need to set yourself up with the C-Bus Diagnostic utility so that you can actually see what commands are going around on the C-Bus network to debug your setup further.
     
    Last edited by a moderator: Jan 26, 2011
    Newman, Jan 26, 2011
    #10
  11. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Thanks for the leads - I've looked again at the example temperature project.

    I'm probably using the wrong words but this is what I think I've done wrong?!
    I created a level component as a single group called 'Bed 1 Set Point'.
    Then under visual properties tab I chose c-bus group address custom (0-50)

    What I think I need to do is change it to 'real' 'system IO'.

    I'll let you know how I get on

    Thanks again, Aaron
     
    Aaron, Jan 26, 2011
    #11
  12. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Hello All,

    I've finally got this working to a fasion, but have some q's??

    I've set the digital room sensors (5031RDTSL) up in sensor mode 6031TS on the Temperature Broadcast application.
    I can monitor the room temperatures as level components within PICED.
    Within the visual properties tag I have to carry out a 'group address custom and scale to 0-50.
    Ive also set up the 'set point' as a level component within the same Temperature Broadcast application.
    Now the maths works as expected, ie it switches around set point +/- hysterisis.
    But the room temperature seems low (approx 5 deg???)
    I've corrected this with the 'offset' feature within toolkit for that sensor.

    Why??
    Where did I go wrong??
     
    Aaron, Feb 20, 2011
    #12
  13. Aaron

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    Is there any particular reason you used 6031TS mode?

    If al you want to do is broadcast a temperature reading and use it in logic, then using the Measurement Application mode is the way to go... there are no silly conversions from group address levels to degrees... the actual reading is broadcast in degrees. You can still use the level components in PICED - you just set them to show the Inbuilt SystemIO "Measurement Application Real Value" (don't forget to add the measurement channel in the measurement manager).

    If you want to integrate with a C-Bus Thermostat or display the temperature on an HVAC widget in Wiser - then use the HVAC Application option. These are the only reasons I can think of to use this mode (and neither of them are particularly good ones).

    The other two modes are to support legacy behaviour, and have little value I can see.

    As for your 5 degree offset... it could be a number of things but a common one is that your perception of temperature is often "calibrated" by a less accurate source... the sensor itself is digital and has a typical accuracy of +/- 0.5C at 25C and a worst case accuracy of +/- 1C over the range -10C to +85C.

    Otherwise it can depend on placement..
    -is it closer to the floor or the ceiling?
    - is it in a draught?
    - is it mounted on a cavity wall where the internal wall temperature is lower?

    Picking the right place for the sensor is a challenge (especially given it's not the easiest thing to look at and mounting options are limited).

    Nick
     
    NickD, Feb 20, 2011
    #13
  14. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Hi Nick,

    initially I had used the inbuilt system IO but in 6031TS mode, the logic didnt seem to work as expected. ie it would switch but not around the set point. seemed to display correctly, but in logic seemed to switch 5 deg low??
    see earlier posts.

    what application should my set point be in??

    slightly off topic - is there a way to change all components in the same group on a page to a different application?

    Aaron
     
    Aaron, Feb 21, 2011
    #14
  15. Aaron

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    I had a look at your earlier posts.. it sounds to me like the problem might be that your conversion of the temperature from the Temperature broadcast application is wrong. This would probably explain the 5-6 degree error you are seeing.

    There is no good reason I can see to use the 6031TS mode... it's just confusing everyone, which I why I suggest you change it to Measurement mode. This way, there is no conversion necessary.

    To do this..

    1) Change the mode of the 5031RDTSL using Toolkit.
    - Select a unique DeviceID and remember the value
    - Set the Broadcast interval to something sensible like 1 minute
    2) Add a new measurement channel in your PICED project
    - (Project -> C-Bus Applications -> Measurement Manager
    - Click "Add"
    - Give it a name
    - Select the network it's on
    - fill in the DeviceID you chose in 1)
    - select channel 1
    3) create a level component to monitor the value
    - Click the "%" button on the tool bar to place a new component
    - double click the component you just placed
    - go to the SystemIO tab
    - change the Key Function to "Status"
    - set the "SystemIO Variable" to inbuilt, and choose "Measurement App Real Value"
    - choose the name channel name you created in 2)

    Now, when you download this to your touchscreen (or simulate it) you should see the actual temperature as broadcast.

    Unless you are trying to change the setpoint from another device on the bus, the setpoint doesn't need to be on any Application. I would suggest you make it a Real System IO variable. You can create buttons or a slider to adjust the value of a SystemIO variable just the same as you would adjust a lighting group level.

    Nick
     
    NickD, Feb 21, 2011
    #15
  16. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Hi Nick,

    Thanks again - I'll give this a go and let you know.:)

    Aaron
     
    Aaron, Feb 21, 2011
    #16
  17. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    hello again,

    Ive loaded this into piced and toolkit (but not tested it for real yet)
    I know its picky, but there dont seem to be any units for the temp
    Did I miss something?

    Aaron
     
    Aaron, Feb 21, 2011
    #17
  18. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    hello again,

    Ive loaded this into piced and toolkit (but not tested it for real yet)
    I know its picky, but there dont seem to be any units for the temp
    Did I miss something?

    Also, in my logic/code how do i refer to the new measurement?

    TIA:)

    Aaron
     
    Aaron, Feb 21, 2011
    #18
  19. Aaron

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    You can set text to be displayed before and after the value in the "Value" sub-tab on the "Visual Properties" tab for the component.

    Use the GetIBSystemIO function - check out the help for details.

    Nick
     
    NickD, Feb 21, 2011
    #19
  20. Aaron

    Aaron

    Joined:
    Jul 16, 2009
    Messages:
    99
    Likes Received:
    0
    Location:
    Wales, UK
    Hello again,

    I searched for the following in the logic help file
    "Use the GetIBSystemIO function - check out the help for details."

    found

    GetIntIBSystemIO

    would I use something like

    GetIntIBSystemIO("Measurement App Real Value", 254, 103, 1)

    Also, in PICED when I select

    'system I/O Custom' in 'value' sub tab of the 'visual properties' tab
    so that I can post fix text a 'C'
    the text position seems to default to a fixed size??
    which is too big??

    Aaron
     
    Aaron, Feb 22, 2011
    #20
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.
Similar Threads
Loading...