Too many long constants - What The !!!

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by richy, Feb 6, 2006.

  1. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    Please explain.

    Becuase the manuals definition, is not heart warming :mad:

    Error C254: Too many long constants
    The maximum number of long constants has been exceeded.

    There is a max?
    What is it?

    I have many constants I have defined, never got this compile error. Only started getting it once I started to reference more constants in my Modules.

    Is this a limitation to the logic engine in HomeGate?

    Is there a way around this ??
     
    richy, Feb 6, 2006
    #1
  2. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    Can one of the CIS members please help.

    I have had to eliminate much of my functionality, in order to get around this compile error.

    Cheers
     
    richy, Feb 7, 2006
    #2
  3. richy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Long constants include such things as real numbers, large integers and string constants. The logic engine has a limit of 200 of these inside the body of a procedure or the modules combined.

    I will get the help file updated to clarify this and other error messages.
     
    Darren, Feb 7, 2006
    #3
  4. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    Thanks Darren,

    This may be a silly question. Correct me if I'm wrong. If I am exceeding the limit, I could just ignore the constants, and write the actual value in the Modules.

    I know that would defeat the purpose of a Constant, and it would be a pain having to Ctrl-C/Ctrl-V the values everywhere I want to utilse them, but at least it gives me the opp, to use all my functionality.
     
    richy, Feb 7, 2006
    #4
  5. richy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Don't go replacing defined constants with numbers and so on, as it won't solve the problem. The limit applies to all strings etc regardless of whether they were defined in the constants section or not.
     
    Darren, Feb 8, 2006
    #5
  6. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    This is a serious limitation.

    Yes, I have learnt this the hard way.

    Darren, so what is my next step?

    I am halfway through the programming, and already I have exceeded the limit.

    Is there a way to construct, then de-construct these strings. So the compiler see's that I will never exceed my limit, I will only have certain modules activated, at any one time. Therefore, when running, will never exceed the 200 max limit.
     
    richy, Feb 10, 2006
    #6
  7. richy

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,392
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    Hi Richy

    I guess Darren may give a more complete answer in a day or so, if he disagrees with mine...

    The limit applies at compile time. So modules and activating / deactivating them won't make any difference, because at compile time the whole shebang is put together and that when you bump into the limits.

    The only suggestion I can give you is to look very carefully at what you are trying to do. Can you make use of the built in schedules and scenes?

    We see many examples of logic code where too much is being done in logic, and the powerful built-in facilities are not being used. There have been numerous examples where 500 lines of logic can be replaced with 10-20 lines when the other facilities are used.

    Don't know if this will help you or not...
     
    ashleigh, Feb 12, 2006
    #7
  8. richy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Ashleigh is correct.

    I can only suggest that you send your code into tech support (marked to my attention) so that we can see why you are having this problem. Nobody else has had this problem before...
     
    Darren, Feb 12, 2006
    #8
  9. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    Thanks guys,

    I will review the code, and see if it can be done some other way, using the built in facilities. If I run out of ideas, I will send in the code.

    Regards,
    Rich
     
    richy, Feb 27, 2006
    #9
  10. richy

    richy

    Joined:
    Aug 8, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    VIC
    I can not find any other way of sending a RS232 String, without utilising a String Constant.

    Please let me know if I am wrong.
     
    richy, Mar 1, 2006
    #10
  11. richy

    Darren Senior Member

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

    Send your project archive into tech support and ask them to get me to have a look.
     
    Darren, Mar 1, 2006
    #11
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.