Master to Master Communication
remeolb
Posts: 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?
-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
0
Comments
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)
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.
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
That was incredibly helpful. Thanks a million!!!
meh, it was just o.k. .
Just kidding. Nice writeup.
--John
'meh' is my new favorite word nowadays.
Roger McLean
Swinburne University
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.
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.
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
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.
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.
That tech note pretty much covers it. I use this exact setup in my house and it has worked without issues for years.