Logic Engine

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Rossco, Apr 28, 2005.

  1. Rossco

    Rossco

    Joined:
    Aug 15, 2004
    Messages:
    59
    Likes Received:
    0
    Location:
    Victoria
    I have noticed the logic engine cannot delay for under 1 second, is there another way to get around this.
    the code compiles alright but I get a run time error ( R011 Minium delay time is 1 second)
    I need to oscillate a serial output every 0.2 of a second.
     
    Rossco, Apr 28, 2005
    #1
    1. Advertisements

  2. Rossco

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    There is no way around this at the moment.
     
    Darren, May 2, 2005
    #2
    1. Advertisements

  3. Rossco

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,373
    Likes Received:
    16
    Location:
    Adelaide, South Australia
    Delays of < 1 second are undesirable for other reasons also - some of the standards that automation systems are required to meet demand that there are no short delays in combination with an ability to create loops.

    If means that this kind of thing (example below) whilst maybe technically possible is forbidden by the standards. Don't raise a witch hunt about why or otherwise this might be desirable....

    while (true) do
    begin
    delay (0.1 seconds);
    turn light on;
    delay (0.1 seconds);
    turn light off;
    end;
     
    ashleigh, May 2, 2005
    #3
  4. Rossco

    Htnut

    Joined:
    Aug 4, 2004
    Messages:
    97
    Likes Received:
    0
    Location:
    Sydney
    Can you be more specific about which automation system standards you are referring to ? In my opinion this limitation is quite serious. For example if one wants to increase the volume of an amplifier the 1 second increments are too slow.
     
    Htnut, May 2, 2005
    #4
  5. Rossco

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,373
    Likes Received:
    16
    Location:
    Adelaide, South Australia
    To increase the volume on an amplifier, use a ramp over a period.

    We find a 4 sec ramp is just fine.

    And this only sends two messages on cbus - one when you press the button to start the ramp, and one when you let go.

    The standard is an emerging European one for automation systems. I believe its not mandatory yet but it will be soon. It forces us to be a little more clever in how some things are done (great - as if there is not enough else to do).
     
    Last edited by a moderator: May 3, 2005
    ashleigh, May 3, 2005
    #5
  6. Rossco

    darrenblake

    Joined:
    Nov 1, 2004
    Messages:
    151
    Likes Received:
    0
    Location:
    Melbourne
    Logic engine and timers

    Hi,
    I have also found the minimum timer of 1sec to be problematic. Some venetian type motorised blinds require a very quick signal (around .5sec) to pulse the louvres open or closed. Any period longer than this actually begins to either lift or drop the venetian blinds depending on direction. Timers at least down to half a second would be an advantage
     
    darrenblake, May 3, 2005
    #6
  7. Rossco

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,373
    Likes Received:
    16
    Location:
    Adelaide, South Australia
    A shutter or blind control cbus output unit would be the best solution of all...
     
    ashleigh, May 3, 2005
    #7
  8. Rossco

    Ross

    Joined:
    Aug 3, 2004
    Messages:
    174
    Likes Received:
    0
    And we shall see one
     
    Ross, May 3, 2005
    #8
  9. Rossco

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    ...
    Have commissioned a large project full of external shutters like those you describe (in my previous life) For shutters that require a pulse for tilt up/down then when you hold a channel on, the shutter adjusts fully then pulls up or rolls down, I would strongly recommend leaving control at the base C-Bus level without any other process involved ie logic, scene, timer etc. Each additional process adds minute (little) delays which accumulate. These type of blind controlers require control as close to instant as you can get...

    ??? V8s and alcohol = ???
     
    Phil.H, May 3, 2005
    #9
  10. Rossco

    Rossco

    Joined:
    Aug 15, 2004
    Messages:
    59
    Likes Received:
    0
    Location:
    Victoria
    Under 1 seconds delays are very useful in sending serial commands. EG. a amplifier, when each command only adjusts volume by 1db or a projector to adjust bightness.
    Other automation control systems we use (Crestron) can have delays down to 0.01 seconds, which we never have any problems with.
    I understand you don't want to delay anything under 1 second for cbus but when controlling through the serial port or over ethernet it is required quite frequently.
    Without the feature it makes controlling many devices via serial basically useless.
     
    Rossco, May 3, 2005
    #10
  11. Rossco

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    When ever I have written serial protocols I don't use a delay() function. Have you found delaying on serial comm ports to be especially useful? Although I can see the points you make about having sub 1 second resolutions for TCP/IP and Serial comms, I think the saying "Without the feature it makes controlling many devices via serial basically useless" is not quite true.

    My caveat to this is that i haven't tried to implement a serial protocol on a PAC controller.
     
    Richo, May 4, 2005
    #11
  12. Rossco

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,373
    Likes Received:
    16
    Location:
    Adelaide, South Australia
    The trouble with a generic programming environment is that allowing abuse on one I/O port and forbidding it on another is VERY difficult. Adds a large amounts of complexity to the underlying software.

    I've been writing code for >20 years, and much of that is driving all manner of strange communication protocols and devices, and the only time I have ever need fine resolution timer / delay control was for wireless C-Bus with the collision detection & backoff algorithm. I've never needed fine resolution timers / delays for things like serial ports.... in general if you need it, you are doing something wrong and should try and find another way. Perhaps a state machine.....

    As a generalisation, communication protocols should use timeouts as solutions of last resort (ie something was supposed to happen within X, so I will wait for about 10 x X and if I then get a timeout I know I have a disaster).

    So.... Think carefully... maybe you can find some other way that does not rely on fine time delays. And remember if we somehow figured out how to magically allow it for serial IO, you can be sure somebody else will use it for C-Bus...

    And you know what will happen if fine delays are used on C-Bus.... it will break when network traffic gets to some threshold level, or when MMI / status reporting is set to run too frequently, or something like that.
     
    ashleigh, May 4, 2005
    #12
  13. Rossco

    Rossco

    Joined:
    Aug 15, 2004
    Messages:
    59
    Likes Received:
    0
    Location:
    Victoria
    Ashleigh
    I see your point.
    Example : with marantz receivers the string will change the db level of the volume by 1db each time it is sent, therefore the volume will only change 1 db per second via colour touch screen, pac or homegate, this change is very slow, it is the way the protocol in the marantz is written, to get around this using other automation control systems is to use a oscillator or delays of under 1 second (about .05 to .1) eg. crestron, this seems to work very well with no problems.

    I know it is hard to make the system fool proof, but where do you draw the line, make the system sort of fool proof and not very compatible and easy to use for the guys learning, not everyone knows pascal and if they don't they shouldn't be using it (warranty VOID).

    I just see this as a big disadvantage if this sort of control cannot be achieved.
    The screen so far looks great and can see we would be using then instead of other screens if it has the same functionality.
     
    Rossco, May 4, 2005
    #13
  14. Rossco

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,373
    Likes Received:
    16
    Location:
    Adelaide, South Australia
    Hmm. This is a bit of a difficult one. We'll have to have a talk about this and see what neat ideas we can throw up.

    I cannot promise a quick solution, and the obvious short-delay-and-loop is pretty yuk (as my previous posts point out), but I have already had a cunning idea... Will discuss with the developer....
     
    ashleigh, May 5, 2005
    #14
    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.