Network & Application as integer no work?

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by JasonCox, Oct 5, 2006.

  1. JasonCox

    JasonCox

    Joined:
    Aug 17, 2004
    Messages:
    75
    Likes Received:
    0
    I was trying to turn some of my projects into template based pages etc the other day, when I thought I would try and use a global integer for the network and application part of my code. The help file says you can do it, but it just doesn't work. Even when I tried to replace the integer with just 254 on its own, it didn't work. - and yes, my network was 254. The only thing that works is the TAG.

    The reason for this is because the project name in toolkit is limited, I use the network name for extra information, so not every projects network is called 'Local Network'

    Is it me or is there something wrong?
     
    JasonCox, Oct 5, 2006
    #1
  2. JasonCox

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I have just tested the following code and it worked correcty :

    Code:
    { global variables section }
    Net : integer;
    
    { module code }
    Net := 254;
    SetCBusState(Net, 56, 32, ON);
    
    Can you provide an example of the code which didn't work and a description of what you mean by "it didn't work".
     
    Darren, Oct 6, 2006
    #2
  3. JasonCox

    JasonCox

    Joined:
    Aug 17, 2004
    Messages:
    75
    Likes Received:
    0
    First, sorry about the delay but I have looked into my problem a bit more...

    I think I might have an idea on this. My code below doesn't work, but if I change "Heater 1" to a decimal value - It works!

    Is there any way to have mixed integer and tag C-Bus commands?

    If this was possible, then long code changes for each touchscreen could be reduced with more 'transportable' based coding.:)


    Global Variables:

    NetworkName, Application : Integer;

    Module:

    NetworkName := 254; (Local Network)
    Application := 136; (Heating Network)
    Once GetCBusState(NetworkName, Application, "Heater 1") then
    SetLightingState("Living Panel Heater", ON);
     
    JasonCox, Nov 10, 2006
    #3
  4. JasonCox

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I will have a look into why this doesn't work.

    I don't think that writing code like this is a greta idea anyway. If you are doing it for transportability, then use a constant for the group address too, rather than relying on a tag which may or may not exist in the new project.
     
    Darren, Nov 10, 2006
    #4
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.