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
I know this is an old post but.... everything you ever wanted to know about master to master configuraiton is available on help site @ https://help.harmanpro.com/comprehensive-explanation-of-netlinx-master-to-master