Home AMX User Forum AMX General Discussion

M2M comms

Are all events and send_commands broadcast to all masters in the URL list?

My original thought was that is wasn't and that TP pushes let's say for a TP on system 1 would only be seen by master 1 but now I'm thinking that's not the case at all and I can put event handlers in any master I want to handle events on a button push from a TP with a DPS of any system. So I can have an event handler for dvTP (10001:1:1) in system 2 and it will run fine as long I have dvTP declared as 10001:1:1 in system 2.

Basically all events and send_commands are broadcast to all masters in the URL list and if there is code that applies to something defined in a master it will execute regardless of whether that defined device is defined as being part of that system.

Is this a correct assumption?

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    I?m not privy to the internal workings so I don?t know if each message is sent once as a broadcast (like you would with UDP) to all the masters or if each message is sent on a one to one basis (like you would with TCP) to each master but they do all get there.

    That said, the rest of your assumptions are correct. You can have an event handler for dvTP (10001:1:1) in system 2 and it will run fine as long as you have dvTP declared as 10001:1:1 in system 2.

    And if system 1 code tells button 1 to turn ON while system 2 code is telling button 1 to turn OFF, then you've got a real mess on your hands. :)
  • viningvining Posts: 4,368
    Joe Hebert wrote:
    And if system 1 code tells button 1 to turn ON while system 2 code is telling button 1 to turn OFF, then you've got a real mess on your hands.
    This is my first time working with multiple masters and I'm obviously just begining to get my head wrap around this whole M2M concept but in affect it's no different then having two sections of code in the same master working against each other. It just ain't good!

    This confirmation does shatter all my preconceived expectation of how it works and thankfully the way it works is more to our favor.

    Seeing how I'm too lazy to go back and read previous threads do you guys prefer tracking virtual channels, sending string/command to virtual devices or a combination of both depending on the situation to track variable across the entire system? And if there's another option not mentioned what is it?
  • I like to set up a virtual device for M2M communications and then use channels and levels to pass info. I also generally have one master "own" a device - directly connected via serial/IR or only one master controls an IP-based device. All of the masters have a data_event for the comm device for the times I do pass strings (rare) and all have channel and level events that will trigger actions on the devices that they own.
  • viningvining Posts: 4,368
    Danny Campbell wrote:
    I also generally have one master "own" a device
    That basically what I've done.

    Since I started this with my preconceived notions still in tact I set up all my TPs and KPs to live on Sys 1 cuz thats where the majority are equipment, control and code resides and since the other systems for the most part are just for local equipment and with only local TP/KP control I put the comm modules for the local equipment on the local master and then instantiated the UI modules for the local systems on the main system (Sys1). Because of my preconceived ideas I didn't expect this to work with out some further brain storming but much to my suprise and joy it worked perfectly which is what led to re-think what I thought.

    I'm not one that typically like to track channels but I guess w/ M2M it's probably the most effiecient and easiest to implement.
Sign In or Register to comment.