Guide: Using 5504DTSI to set EDLT Page Key Colour

Discussion in 'Pascal Logic Code Examples' started by chromus, Jan 8, 2020.

  1. chromus

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    126
    Likes Received:
    14
    Location:
    Perth
    Hi All,

    I had a client want to use the DTSI5504 (4ch temp unit) and some logic to control sweepfan speed and this got me thinking about using similar code for my salt water aquarium, these things suffer greatly if the temperature varies too much from 26C .

    Basically this code reads the temperature channel that has a probe in the tank and then grabs it and sets a channel level based on the temperature to change the page key on EDLTs in both active and Standby to reflect the aquarium temperature. There is no reason you couldn't use this for wine cellars, or swimming pools or anything else with a Too Low / Good / Too High temperature environment (including beer brewing).

    You will need to create a GA and assign it to the Page key as per screenshots (see ED1 and ED2) in this case it is "EDLT Text Colour" and set the colours according to need.
    ED1.PNG ED2.PNG
    My DTSI is on network 254, it is measuring device 1, and the channel being used is 4

    You will need to setup he measurement app (see ED3) if you haven't already
    ED3.PNG
    Then the code which can go on a touchscreen (with logic) /wiser is as per below

    Variables
    Code:
    r_edtemp: real;
    
    Module
    Code:
    {Sets EDLT Indicator colour based on tank temp to indicate dangerous tank temps}
    //set to EDLT Page Key Indicator to Blue of tank <= 25C
    //set to EDLT Page Key Indicator to Red if tank >= 28C
    //set to EDLT Page Key Indicator to White if tank >25C or <28C
    
    once (Second = 59) then // IMPORTANT - don't run this code every cycle - once a minute is ample
        begin
        r_edtemp := GetRealIBSystemIO("Measurement App Real Value", 254, 1, 4);  // network 254, device 1, ch 4
      
           if r_edtemp <= 25.0 then
           SetLightingLevel("EDLTTextColour", 30%, "0s")
    
           else
           if r_edtemp >= 28.0 then
           SetLightingLevel("EDLTTextColour", 60%, "0s")
      
           else
           SetLightingLevel("EDLTTextColour", 100%, "0s");
     
      end;
    
    Credit to @bmerrick as some of this content is based on his previous posts.
     
    Last edited: Jan 8, 2020
    chromus, Jan 8, 2020
    #1
    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.