Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Using Scheduler with General Logic

  1. #1
    Automated Home Sr Member mcockerell's Avatar
    Join Date
    Jan 2009
    Posts
    72

    Default Using Scheduler with General Logic

    Hi,

    I have been experimenting with a combination of scheduler events and general logic in the hope of having more flexibility than provided by lighting scenes - I want to control external and internal lighting based on time of day and day of week, with overrides for if I'm working from home, if we're out for the evening or away on holiday.

    The logic side is easy to configure, but I am having difficulty setting up the scheduler events - when I try to add an event action function it gives me two selections for the same general logic input (each with the same name), but neither seems to establish a connection to the general logic element itself.

    Am I missing something obvious, or is it just that this type of arrangement isn't possible?

    Thanks,
    Martin

  2. #2
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Quote Originally Posted by m****erell View Post
    Hi,

    ... when I try to add an event action function it gives me two selections for the same general logic input (each with the same name),...

    Martin
    This is an error but does not affect the functionality. Its just offered twice.

    A few notes about Scheduler and Logic Gates etc.

    In Cortex, information is transfered around via its connections. The output of an object (A) is connected to the input of another object (B). When the output (A) changes, object (B) is informed. Object (B) then intergoates Object (A) and askes what the state of the output of Object (A) is on this connection. Depending on the type of object (B) it may react simply to being pinged on that input or may take the output state of (A) to make a decision on what to do.

    1. The Scheduler makes temporary connections to things when the event happens. So this is not ideal for gates that evaluate static conditions such as AND, OR, XOR etc, but will work until the gate is re-evaluated.

    2. The logic gates, SR Flip-Flop, Monostable, T Flip-Flop, have set, reset and clock inputs. They all evaluate the sender for 'True' in order to react (unlike some real hardware which is often negatively edge or logic low triggered).

    3. For the scheduler to trigger the S, R, or CLK inputs the Scheduler state should be set to '1'.

    If this information does not resolve your problem, can you provide more detail i.e. the type of scheduled event and what type of gate you are connecting to.

    Viv.
    Last edited by Viv; 27th October 2011 at 11:19 PM.

  3. #3
    Automated Home Sr Member mcockerell's Avatar
    Join Date
    Jan 2009
    Posts
    72

    Default

    Hi Viv,

    Thanks for the information, most helpful.

    I have now connected the scheduler event outputs to the S/R inputs of an SR FlipFlop logic element but am not seeing the latching taking place - I have set the action state to 1.

    I also played with the Time Window logic element instead; this seems to work as expected, but unfortunately doesn't give me the flexibility to select which days it applies to - I need only weekdays for part of the logic.

    I'm also seeing a problem if I connect a QBI button to the CLK input of a T FlipFlop logic element - again I'm not seeing the output toggle when the button is pressed. This QBI is also used for Cortex pause/run - does having Reflex & Cortex enabled affect button operation?

    Thanks,
    Martin

  4. #4
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Quote Originally Posted by m****erell View Post
    Hi Viv,
    I have now connected the scheduler event outputs to the S/R inputs of an SR FlipFlop logic element but am not seeing the latching taking place - I have set the action state to 1.
    Martin
    I have tried the SR Flip-Flop and triggering the S and R inputs from the Scehduler and it seems to work fine for me. In the scehduler I had the value set to '1' in both entries.
    I was able to set and reset the flip-flop.

    You can have the scheduler events window up and see the 'Done' property go to 'Y' when it fires the output. You can also have the Gate Item Edit menu up and should observer the inputs changing i.e. going to a '1' and the output changing accordingly. Both inputs set to '1' is indeterminant.

    Are you running the latest Cortex 25.2.10 ?

  5. #5
    Automated Home Sr Member mcockerell's Avatar
    Join Date
    Jan 2009
    Posts
    72

    Default

    Hi Viv,

    Yes, I am running Cortex 25.2.10.

    I have been experimenting today and have managed to get scheduler events triggering General Logic; but I have found a problem - they only work if the 'Where' is set to 'All'. I don't want any annunciation so was setting 'Where' to 'Nowhere' for all events; this results in 'Nowhere Error GetPortValue virtual' in the log - any other value (except All) shows as 'Done' but doesn't seem to trigger (there is also no error in the log).

    Also, I still cannot get the QBI buttons to toggle the T-type - any ideas?

    Thanks,
    Martin

  6. #6
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Must admit we had not considered the 'Where' property influencing your results.
    I will try and explain although it may seem quite complicated…

    Consider a button in a room configured to trigger an external temperature sensor to speak its temperature. The temperature sensor offers two inputs, speak local and speak broadcast. The speak local is not local to the sensor but local to the sender, that is the button. So you press a button and hear the temperature spoken in the room where the button and the intercom are.

    The way this happens is the temperature sensor on receiving a ping on its speak local input passes a request to speak certain words to the sound object but as if it came from the button (the sender). The sound object seeing it came from a button looks to see if it is in a room. If it is it then looks to see if an intercom is in that room. Finding the intercom that’s where it directs the spoken words.

    Speaking broadcast sends a request as if it came from a null source. That is then interpreted as broadcast.

    The scheduler is however a special case. It mimics things as if they came from other objects. For example if you want the scheduler to cause the speaking of the outside temperature but in the room where the button is (the above example) then the scheduler pings the temperature sensor as if it came from the room where the button is. This is the ‘Where’ property in the scheduler.

    In your example setting the ‘Where’ property to a room will mean the scheduler will ping the general logic gate as if it came from that room which is not what you want, but is why it does not cause an error.

    The ‘Nowhere’ object is a special case which was added that if the sound object received a message from ‘Nowhere’ is did not speak at all. Your general logic gate is interrogating the ‘Nowhere’ object for a value which has not been implemented but clearly needs to be even if only to not report an error.

    So the simply answer is the scheduler needs to be set to ‘All’ for the moment and the gate should not cause anything to speak.

    I’ll get back regarding QBI buttons.

    Viv.

  7. #7
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default QBI Buttons

    Hi Martin,

    I have tried QBI button 3 connected to T Flip-Flop. Provided T input is at a '1' (I connected to a room which was occupied) then pressing the button toggled the T Flip-Flop output correctly.

    I do not believe having reflex enabled as well should affect its Cortex operation provided that button does not have any reflex vectors.

    Would need more details of button connections and vector details to study further.

    Viv.

  8. #8
    Automated Home Sr Member mcockerell's Avatar
    Join Date
    Jan 2009
    Posts
    72

    Default

    Hi Viv,

    I had another go at using the QBI buttons last night without success.

    I also tried using another switch to toggle the T-type, but this didn't seem to work either (it's normally used to toggle the porch lights on and off so I know it usually works).

    I'm slightly curious about your comment regarding an occupied room; my reading of the help for the T-type says that an unconnected T input defaults to 1 - is this not the case?

    I'll try a few more things when I have more time, hopefully this evening.

    Thanks,
    Martin

  9. #9
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    I add the connection to the T input as I was testing the clk with the T=0 e.g. does not toggle. However I tested disconnected and it does go to '1'.

    Attached images.
    I used Button behaviour menu to simulate button press but real button also works.

    Viv
    Attached Images Attached Images

  10. #10
    Automated Home Sr Member mcockerell's Avatar
    Join Date
    Jan 2009
    Posts
    72

    Default

    OK, I've tried again with no success - I've even deleted all of the logic and rebuilt just a single gate in the Hall in case it was an issue of scope.

    I'm attaching an image showing the configuration I was testing - the only thing that happened was that I got the message 'House set occupied' when I clicked on Button 3.

    Grateful for any ideas.

    Thanks,
    Martin
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •