System IO between W2 & CTC

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by znelbok, Dec 29, 2017.

  1. znelbok

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,074
    Likes Received:
    4
    I am working on a site that has a Wiser 2 and a CTC.

    I have code running in the W2 that is using System I/O for temperature setpoints. I want the colour touch to be able to adjust the setpoints and any other system IO on the W2.

    Is there a way to do this?

    Some initial thoughts were to create a SysIO application dedicated for sharing the values, but some of them are reals and groups are only capable of integers.

    I could scale by 10 to give 3 significant figures, but that gives me a max value of 25.5 and I may need to go above 25.5

    The wiser app is used predominately hence the reason for the code in the wiser and I want to refrain from partial code in one and partial code in the other - that gets very difficult to troubleshoot if there is an issue.

    Any other ideas - maybe TCP transfer between units with matching system IO on both ?

    Mick
     
    znelbok, Dec 29, 2017
    #1
    1. Advertisements

  2. znelbok

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    686
    Likes Received:
    16
    Location:
    Adelaide, Australia
    Have you thought about using the measurement application? You can write values to the measurement app from logic (via systemio's), and it supports real values. Just pick a device id currently not used and set them up as monitors and whenever you write from one device, the other should pick it up. I haven't ever tried this but in theory it should work :)

    Otherwise you could just scale a ga like you suggested, but since you never need to go to 0 degrees just use an offset. e.g ga = temp * 10 - 10 gives you a range of 10 to 35.5 degrees etc
     
    Ashley, Dec 30, 2017
    #2
    1. Advertisements

  3. znelbok

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,074
    Likes Received:
    4
    Good thinking. This can work, but keeping them in sync may be an issue.

    i.e. The widget on the wiser app that allows the temperature to be changed, makes a change to the vale. This is broadcast on the measurement app and the CTC reads that value - that's easy.

    The CTC has the option to change the setpoint as well - so a change is made and that is then has to be published on the measurement app.

    I now have to read the measurement app and update the sysIO. What happens if the temp is changed on the wiser, but we do a read of the temp from the measurement app before its updated by the code when the temp changes. Complicates things pretty quickly
     
    znelbok, Jan 6, 2018
    #3
  4. znelbok

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    686
    Likes Received:
    16
    Location:
    Adelaide, Australia
    This can only happen if the set point in both device is changed at the same time while is unlikely, and even if it does happen one will override the other.

    the logic in the CTC would be something like

    if hasChanged(<sysIO>) then <setMeasurement>; // Broadcast set point change
    if hasChanged(<measuement>) then set(<sysio>); // Update sysio on set point change

    and in the Wiser much the same except you process the measurement change

    if hasChanged(<sysIO>) then <setMeasurement>;
    if hasChanged(<measuement>) then
    begin
    set(<sysio>);
    <process set point change>
    end;

    Since this happens every 200mS a clash is unlikely, and if it does one will be missed, but the widgets will still be updated to the correct value.
     
    Ashley, Jan 8, 2018
    #4
    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.