Results 1 to 6 of 6

Thread: Api

  1. #1
    Automated Home Guru Geps's Avatar
    Join Date
    Nov 2010
    Posts
    136

    Default Api

    Hi,

    I'm playing around with the API and on receipt of a IR signal I'm getting the following:

    20:14:30 < NetworkRunningState=9
    20:14:32 < Pulse=1
    20:14:33 < Lounge 1 IR Rx.On Frame received=4
    20:14:33 < Lounge 1 IR Rx.On Frame received=4
    20:14:33 < Lounge Macro.Busy=1
    20:14:33 < Lounge 1 IR Rx.Frame 4=0

    Is there any reason the IR Rx.On Frame line is repeated? It only shows up once in the communications window on Cortex so I assume it's just redundancy?

    Cheers,

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

    Default

    A long explanation :-( ....

    The API is sending messages received from the Cortex internal communication network. That is the messages being transfered from one object to another. This is defined by the connections.

    In addition to the connections set-up by the user in the connections menus (static) their are also temporary connections made by the system (dynamic). For example if you have an intercom session, the cancel buttons on all panels have dynamic connections made to the 'All intercom object' to cancel a session. The cancel buttons are then released for another task at the end of a session.

    The Infrared receiver can be used to mimic the buttons on a panel. So you can sit in your arm chair and operated the panel and navigate menus etc. The buttons are no longer working directly how they are configured in the connections menu but all the buttons actions are steared towards a User defined Menu. The buttons are actioning their dynamic connections.

    So the bottom line is that the output of many objects will trigger their normal connections (static as set by user) and if applicable their dynamic connections (as reconfigured temporarily by the system).

    The API is tied into this interface and is seeing both static and dynamic 'pings'.
    I think it is not appropriate that the API sees the dynamic pings and we will change it in future updates.

    So the simple answer to you question is yes they are redundant.

    Viv.

  3. #3
    Automated Home Guru Geps's Avatar
    Join Date
    Nov 2010
    Posts
    136

    Default

    Thanks Viv,

    The pings you refer to...is that the pulse line in the API?

    Cheers,

  4. #4
    Automated Home Jr Member
    Join Date
    Jan 2006
    Location
    Trowbridge, England
    Posts
    40

    Default

    Hi Geps, by coincidence I've been doing the same thing too. I'm using Delphi what about you?
    I've found the API example code for Delphi didn't work with the versions I've got (Delphi 2007 and Delphi XE) and had to tweak the code slightly.

    The problem seemed to be the run-once code using a semaphore - I replaced it with code using a mutex and it works fine now.

    I've just been playing with switches and relays, haven't got on to IR yet.

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

    Default

    Was referring to the output of one object to another when I referred to pings.
    An update to Cortex is available version 25.2.11 which will resolve the double message problem.

    Viv

  6. #6
    Automated Home Guru Geps's Avatar
    Join Date
    Nov 2010
    Posts
    136

    Default

    Thanks Viv

    Quote Originally Posted by achapman View Post
    Hi Geps, by coincidence I've been doing the same thing too. I'm using Delphi what about you?
    I've found the API example code for Delphi didn't work with the versions I've got (Delphi 2007 and Delphi XE) and had to tweak the code slightly.

    The problem seemed to be the run-once code using a semaphore - I replaced it with code using a mutex and it works fine now.

    I've just been playing with switches and relays, haven't got on to IR yet.
    Interesting question....I was looking to use either VB.net or C# but found that that the Visual Studio debugger was repeatedly crashing (a Google revealed others with the same problem in different software so I'm sure it's not an Idratek issue) in all but the oldest C# example. On restarting my PC it's now working so as I know VB (and C only in an embedded context) I think I will stick with VB for the moment.

    I'm trying to code up an Idranet RS232 gateway for use with some custom RGB lights - what project are you working on?

Posting Permissions

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