Master to Master Communication

remeolbremeolb Junior MemberPosts: 79
How does master to master communication work? I have a job coming up where I will be using 2x NI-3100 and 1x NI-2100. I will be controlling devices via RS-232 connected to all three controllers. I only intend to have one source file which will reside on the NI-3100 if it's possible to do it that way.

-How do I define my masters?

-How do I define my devices?

-Will I be able to see all three masters and connected equipment in my system online tree?

Here is what I have done so far. Do I need to specify the different masters' IP addresses somewhere or is just the system number enough?
DEFINE_DEVICE

dvMASTER1		= 0:1:11	// MASTER
dvMASTER2		= 0:1:12	// MASTER 2
dvMASTER3		= 0:1:13	// MASTER 3

Comments

  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,159
    this will be pretty down-n-dirty, so hang on.


    Firstly, set up your masters with unique system numbers. From your example set up main master as system 11, 2nd and 3rd masters as system 12 and 13 respecively. An easy way to do this is to connect a serial cable to the program port on the NI and your computer. Run Netlinx Diagnostics and set them up there. While there you might want to setup the IP addresses too. I like to keep the system numbers and IP addresses similar. Only the main master has to be a static IP for this to work, but it's a good idea to set the others to static too.

    Example might be
    Master 1 - (system 11 , IP address 192.168.1.11) This one will have the program.
    Master 2 - (system 12 , IP address 192.168.1.12)
    Master 3 - (system 13 , IP address 192.168.1.13)

    Now for making the M2M connection.

    While in Netlinx Diagnostics, you go to the URL List tab. (You don't need to do this on the main master (System 11) only the subordinate masters.

    In the URL List tab, add an URL to the list with the IP address of the main master. (In our example the IP is 192.168.1.11) If all are connected to the network it will show 'connected' in the URL window after a few seconds. After both your sub-masters are setup the connection is made.

    Important!!! do NOt make an URL reference on the main master back to the sub-masters. The connections are 2-way communication. The main master needs no connection back to the sub-masters.

    Now, to using these connected masters in code.

    Just put in a device declaration for the devices on the sub masters. You must make sure to keep the system number correct.

    So, for example, let's make a device for all the serial ports. (I assume NI-3100s for all masters)
    DEFINE_DEVICE
    
    dv_RS232_01_Sys_11  =  5001:01:11 // this is serial port 1 on the main master
    dv_RS232_01_Sys_12  =  5001:01:12 // this is serial port 1 on sub-master 1
    dv_RS232_01_Sys_13  =  5001:01:13 // this is serial port 1 on sub-master 2
    


    Now they're declared and ready for programming. If you want to monitor strings from the serial port 1 on the 2nd master here's what that looks like.

    DEFINE_EVENT
    
    data_event[dv_RS232_01_Sys_13]
    {
    string:
      {
      astringfrommaster3_port1_buffer=data.text
      // do something.
      }
    online:
      {
      send_command dv_RS232_01_Sys_13,' set baud 9600,etc...."
      } 
    }
    
    

    As a rule of thumb, it's a good idea to put a small program on the submasters to set stuff like this up on reboot as well.

    Hope that helps.
    e
  • remeolbremeolb Junior Member Posts: 79
    Eric,

    That was incredibly helpful. Thanks a million!!!
  • John GonzalesJohn Gonzales Junior Member Posts: 609
    That was incredibly helpful. Thanks a million!!!

    meh, it was just o.k. .


    Just kidding. Nice writeup.

    --John
  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,159
    meh, it was just o.k. .


    Just kidding. Nice writeup.

    --John

    'meh' is my new favorite word nowadays.
  • annuelloannuello Junior Member Posts: 294
    I vote to have this thread shifted to the Tips & Tricks section. A beautifully succinct explanation of M2M.

    Roger McLean
    Swinburne University
  • edgelitocedgelitoc Junior Member Posts: 160
    m2m

    Recently I have tried this master to master communication which i have an NI-900 controlling ALD-H48 for our office lighting and NI-3100 for the training room. I need to control the lighting via the touchpanel on training room. I had able to see on online tree both system but it seems i cant control each other. I tried to to ON the I/O ports of NI-900 through telneting NI-3000 but it did not pass... my command like this: ON[5001:5:1,2] .. but it this pass to NI-900 and vice versa....

    NI-900: system 1
    Define_device
    dvReal = 0:5:1 // real device
    vdvLutron = 41001:1:1 // virtual H48 device and keypad 1

    dvLightSensor = 5001:5:1 //Lighting sensor at corridor

    ni-3000 :
    define_device
    dvTP = 10001:1:5 //AMX MVP8400

    dvReal = 0:5:1 // real device
    vdvLutron = 41001:1:1 // virtual H48 device and keypad 1


    Thanks for reading and any help would be very much appreciated..
  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,159
    edgelitoc wrote: »
    Recently I have tried this master to master communication which i have an NI-900 controlling ALD-H48 for our office lighting and NI-3100 for the training room. I need to control the lighting via the touchpanel on training room. I had able to see on online tree both system but it seems i cant control each other. I tried to to ON the I/O ports of NI-900 through telneting NI-3000 but it did not pass... my command like this: ON[5001:5:1,2] .. but it this pass to NI-900 and vice versa....

    NI-900: system 1
    Define_device
    dvReal = 0:5:1 // real device
    vdvLutron = 41001:1:1 // virtual H48 device and keypad 1

    dvLightSensor = 5001:5:1 //Lighting sensor at corridor

    ni-3000 :
    define_device
    dvTP = 10001:1:5 //AMX MVP8400

    dvReal = 0:5:1 // real device
    vdvLutron = 41001:1:1 // virtual H48 device and keypad 1


    Thanks for reading and any help would be very much appreciated..

    well, for starters, you cannot communicate with dvReal from the sub-master. (I think) But, you shouldn't need to anyway. If dv_Real is in contact with the Lutron processor on the first master, it doesn't need to be on the 2nd.

    So, you'd put the Lutron comm module on the master you want to do the heavy lifting. Make your virtual device on that master (41001:1:1 in this case) Then the code in your 2nd or sub master you'd just put the virtual device from the first master. 41001:1:1 again.

    On that second master any code talking to vdvLutron will get over there via the M2M connection. No need to open a 2nd IP connection from the 2nd master.

    another thing too.... make sure you're only doining the master-to-master from one NI only. That's a common mistake at first. So, for example, make sure the URL of the NI700 is in the NI-3100 but not the NI-3100 in the NI-700. The one connection is two-way and both masters see each other.
  • edgelitocedgelitoc Junior Member Posts: 160
    ericmedley wrote: »
    well, for starters, you cannot communicate with dvReal from the sub-master. (I think) But, you shouldn't need to anyway. If dv_Real is in contact with the Lutron processor on the first master, it doesn't need to be on the 2nd.

    So, you'd put the Lutron comm module on the master you want to do the heavy lifting. Make your virtual device on that master (41001:1:1 in this case) Then the code in your 2nd or sub master you'd just put the virtual device from the first master. 41001:1:1 again.

    On that second master any code talking to vdvLutron will get over there via the M2M connection. No need to open a 2nd IP connection from the 2nd master.

    another thing too.... make sure you're only doining the master-to-master from one NI only. That's a common mistake at first. So, for example, make sure the URL of the NI700 is in the NI-3100 but not the NI-3100 in the NI-700. The one connection is two-way and both masters see each other.

    Hi Eric,
    thanks for the quick reply... before i m going to the real program. I am stack on having control of each other,, meaning by using telnet.. I should be able to control port on the other master ,, right... like sending strings to port 1 of NI900 via NI3000... Is there something that i missed... I can see the two system on online tree. Sytem 1 and system 5 ... and I had only put on 1 ip on master's URL list...
    thanks again for your response...
  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,159
    edgelitoc wrote: »
    Hi Eric,
    thanks for the quick reply... before i m going to the real program. I am stack on having control of each other,, meaning by using telnet.. I should be able to control port on the other master ,, right... like sending strings to port 1 of NI900 via NI3000... Is there something that i missed... I can see the two system on online tree. Sytem 1 and system 5 ... and I had only put on 1 ip on master's URL list...
    thanks again for your response...

    I don't think that is the case. ( I could be wroing)

    You could make a workaround by creating a virtual device to act as a proxy for you.

    any string/command you send to the virtual device could send a string to the local port you want. and then visa versa.
  • staticatticstaticattic Junior Member Posts: 200
    Reading this thread made me think of a question regarding M2M. I recently finished a job with multiple masters, one in each room. Each room was an exact duplicate of each other, so I loaded the same code on every single master. The masters are on the network and can see each other. I was originally going to load the code on the "master" master and let it do all of the work. I was afraid however, if for some reason it died, the entire site would go down. However since the same code was loaded on all of them, if any one died, the rest of the rooms could continue to work as normal. What is a good time and way to utilize M2M?
  • ColzieColzie Senior Member Posts: 470
    In my mind the most straightforward example and use of M2M is when using a second master for the ports only. For example if you have a 3100 and are using all the IR ports, you might add another 3100 for the additional IR.
  • ColzieColzie Senior Member Posts: 470
    In re-reading my post, I don't know that what I said clearly illustrates what I was thinking. In my example I was considering a commercial project where 1 touch panel might be controlling 8 TVs and 8 cable boxes. Instead of buying dedicated IR expansion, or a card cage, you might just add another NI for the ports.
  • staticatticstaticattic Junior Member Posts: 200
    Thanks. I understand that clearly. In fact, I have an NI-3100 and an NI-2000 on my desk right now. The NI-3100 does not have ICSNet, but the NI-200 does. Through M2M, I am using the NI-2000 to ramp a VOL-4 card up and down. That works fine on my desk just playing around with M2M. I was more or less asking about big jobs. The job I am referring to had 18 NI-3100's in 18 rooms. Each room was an exact duplicate of the other. The only difference in each room was the IP address of the ClearOne device for volume. So, I made a workspace with 18 Systems. The source code on every one of them was exactly identical with the exception of the IP of the ClearOne in each of the rooms. My thoughts were if I utilized M2M and put all of the code on the Main Master and little bits of code on the sub-masters, if the Main Master died, then the entire site would go down. Conversely, if each Master had the entire source code, then they would not be dependent on the Main Master and could continue to function whether or not the Main Master was there or not.
  • annuelloannuello Junior Member Posts: 294
    For me, M2M design comes down to balancing risk against the benefits. Remember that all M2M is 100% reliant on the stability of your network. Depending on your installation, you may or may not have control of the network.

    Most of my M2M jobs are two meeting rooms with an operable wall, thus making them one large meeting room. The rooms are usually high-profile, so I try to minimise the impact of network/equipment failure. Each room runs its own set of code and I created my own set of commands to pass between the two rooms. When running as one large room, the "master" room sends requests to the "slave" room, which in turn is responsible for controlling it's own devices.

    I have one room where I use M2M purely for the extra devices. I simply ran out of serial ports on a NI-3100, and had to add one NI-700 to get an additional serial. The device that the NI-700 controls is in the same room as the NI-3100, so in the event of a M2M-related failure the impact would be contained to the one room.

    For my classrooms (200+ rooms) I use the same code in all rooms, all with NI-700 masters. While it could be possible to build an "all singing all dancing" master to control all the rooms, the risk is too great to rely on one master running correctly for all rooms. It becomes a bit of a challenge pushing out code changes to so many masters, but that is life.

    Roger McLean
    Swinburne University
  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,159
    I can say that the only time M2M has been an issue with me had more to do with the Touch Panels finding the wrong master to connect to. Even though I'd configure the masters to not broadcast and the TPs to static master IPs, etc .... I'd still find a panel resetting itself back to factory settings and finding the wrong master.

    My work around is a small program on the sub-masters that shoos away the TPs if they come a calling. The submaster telnets into the wayward panel and resets it back to the right master settings and reboots it.

    Since doing this I've not ran into any issues with code being on a main master and submasters essentially being expansion ports for IR/RS2332/etc...

    We, however, without exception are in control of the networking gear in all our AMX systems.
  • staticatticstaticattic Junior Member Posts: 200
    I was given a subnet to work with and told I could come up with whatever IP scheme I wanted to. That was about the extent of my control over my portion of the network. Something I did recommend that they chose not to do, was to put a little 5 port switch in each room. That would allow the TP and Master to see each other internally to the room even if their network crashed. They did not want to go that route, so in a way, they did put all of their eggs in the basket with the main network switch. If for whatever reason that died, they would lose everything anyway, including their computers, VBricks, AMX control, video switches, ClearOne devices, etc. For that reason alone, I kinda wanted to load my main code on one master and small bits of code on the sub-masters. I couldn't really justify it other than the fact that I wanted to play with M2M in a big environment. I took the conservative route instead. Although, while I was loading the same code over and over, I couldn't help but wonder if there was a better way to accomplish what I wanted to do.
  • staticatticstaticattic Junior Member Posts: 200
    ericmedley wrote: »
    I can say that the only time M2M has been an issue with me had more to do with the Touch Panels finding the wrong master to connect to. Even though I'd configure the masters to not broadcast and the TPs to static master IPs, etc .... I'd still find a panel resetting itself back to factory settings and finding the wrong master.

    My work around is a small program on the sub-masters that shoos away the TPs if they come a calling. The submaster telnets into the wayward panel and resets it back to the right master settings and reboots it.

    Since doing this I've not ran into any issues with code being on a main master and submasters essentially being expansion ports for IR/RS2332/etc...

    We, however, without exception are in control of the networking gear in all our AMX systems.

    I have a question about a panel resetting back to factory settings and shooing away wayward TP's. I am assuming by "factory settings" you are referring to out of the box conditions, with the exception of the GUI. I am also assuming your network utilizes DHCP for IP assignments. If so, then if a TP got zapped, it would pull a new IP and then look for its master. Are your masters polling MAC addresses of the TP's? The MAC address, I would think, would be the only constant in the equation. Can you shed some light on this? I am not asking for your code or asking you to write any code for me. I was hoping you could provide a few sparks so I can start my own fire. Thanks.
  • HedbergHedberg Junior Member Posts: 671
    TPs come setup for DHCP and auto-connection to a master. So, if you have a master on the network with UDP enabled and a DHCP server and plug in a new TP, the TP will respond to the masters probe and connect right up with no problem. Never seen one go back to that configuration after having set the master to URL, entered the master's static IP address , and entered the IP address for the TP, but I've seen stranger things.
  • adcantrelladcantrell Junior Member Posts: 24
    So im in a system where I need a pool house system to be able to control the sources from the main houses matrix switcher,etc so how would I set this up? The pool house ni700 has its own sources but also has 6 or 7 sources on the ni3100 that it needs to be able to control as well as the matrix switcher etc in the main house. theyre both on the same network and thru the URL list i can see the main master but how would i code the ni700 master to be able to control main master sources? /facepalm/
  • MaracaerMaracaer Junior Member Posts: 25
    ni-700 with an accent 3 as a slave

    hello all,

    just wondering how to set up a system here on my desk with an ni-700 as the master and an accent3 as a slave. Is it similar to m2m control? or not really? thanks in advance.
  • John NagyJohn Nagy CineTouch Product Manager Posts: 1,526
    Maracaer wrote: »
    hello all,

    just wondering how to set up a system here on my desk with an ni-700 as the master and an accent3 as a slave. Is it similar to m2m control? or not really? thanks in advance.
    See AMX Tech Note 158 for details. The Axcent3 becomes an AXLINK device on the Netlinx tree.
  • the8thstthe8thst Junior Member Posts: 470
    John Nagy wrote: »
    See AMX Tech Note 158 for details. The Axcent3 becomes an AXLINK device on the Netlinx tree.

    That tech note pretty much covers it. I use this exact setup in my house and it has worked without issues for years.
Sign In or Register to comment.