5031TS Temperature Sensor problem

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by impact, Feb 16, 2010.

  1. impact

    impact

    Joined:
    Feb 10, 2008
    Messages:
    117
    Likes Received:
    14
    I am trying to read the temperature from a 5031TS sensor.

    I understand this device does not automatically broadcast anything, and it has to be queried as required (and not to do it frequently so as not to flood the network)

    I have read the posts at http://cbusforums.com/forums/showthread.php?t=5488&highlight=5031ts
    and
    http://www.cbusforums.com/forums/showthread.php?t=1229


    So I know I need to use the GetUnitParameter Function. Ideally I want to display the temperature on a mk2 touchscreen when the user selects a page to display. I think I understand systioio variables and how to invoke code from a screen, and how to get results displayed to the screen - as I have other little programs I have written working fine that claculate and do things that interact with the user...

    But I seem to be stumped in getting a reading from the 5031ts.

    I have only 1 network on this setup, no bridges, nothing strange, have not changed any names or the like.
    I am using software which until the last few days was the most recent. I want to solve this problem before I update to the latest.

    If I use the toolkit, I can see the 5031TS is on the network, healthy, and I can scan and get the temperature reading. According to the toolkit it is Address 150 on the 'Local Network", application set as 'Heating (Legacy)'

    So I was under the impression that the command follows would return the temperature for me;
    LivingTemp := GetUnitParameter("Local Network", 150, ptTemperature);

    Where LivingTemp was previously set as type of Real. Displaying the contents of LivingTemp results in 0 through piced.

    Checking on the availability of the unit via
    if GetUnitParamStatus(1, 150, ptTemperature) then ....
    results in false or not available or error....


    An experimental piece of code like;
    LivingTemp := 1.1;
    if GetUnitParamStatus(1, 150, ptTemperature) then
    begin
    LivingTemp := 2.2;
    LivingTemp := GetUnitParameter("Local Network", 150, ptTemperature);
    end;
    SetRealSystemIO("MBRTemp",LivingTemp);

    To determine where and what occurs - shows me that LivingTemp is displayed as 1.1 - so I never get into the loop for doing stuff..

    I thought maybe there was a decimal / hexadecimal issue - so I tried 150dec = 96hex - same deal....

    What am I doing wrong.....
     
    impact, Feb 16, 2010
    #1
  2. impact

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    Sounds like you're almost there...

    In order for the GetUnitParameter and GetUnitParameterStatus functions to work, you need to have a monitor set up for this parameter... it's the monitor component that goes off and retrieves the value from the unit... the logic functions just give you access to the value of the monitor from logic.

    To add a monitor, go to the Project->Monitors menu and add the details in the Monitor Manager dialog.

    Let us know if that sorts it.

    Nick
     
    NickD, Feb 16, 2010
    #2
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.