General Network Question - Routers


#1

This is more of a general network question, but since it involves a couple of R2 controllers, I thought I’d post here to see if anyone else has done this or perhaps suggest alternatives.

Here’s the configuration. I have two cabinets, each with an embedded PC and two SNAP R2 controllers, each on a 16-slot rack (one for inputs, one for outputs). The cabinets run independently. A simple Ethernet switch is installed in each cabinet allowing the PC and R2s to communicate.

In each cabinet, one R2 runs the strategy. The strategy includes two I/O Units, the R2 running it and the other R2. I’m writing a program on the PC that will communicate directly with both R2s to retrieve I/O and scratchpad data.

So far so good. I can set the PC and R2 addresses the same for each cabinet (e.g. PC = 192.168.1.10, R2(1) = 192.168.1.11, R2(2) = 192.168.1.12) and I can run the same program and strategy in each cabinet.

Now I want an external PC to be able to retrieve I/O and scratchpad data from both cabinets. So, I will have to connect both cabinets to the external Ethernet network (through the aforementioned network switch). Problem is I will have address conflicts because both cabinets use the same IPs and now they can “see” each other.

I really don’t want to have two separate strategies/programs with the only difference being the IP addresses.

I don’t know much about networking but I think I need a router for each cabinet between the external network connection and the switch. The router will forward packets from the external PC to the proper R2. Does this sound right? Is there another way I can do this? If I do need a router, any suggestions (make/model)? I’ve googled routers and most of what comes up are wireless routers or cable/dsl modems.

Thanks again and sorry for the general nature of the question.


#2

Here’s a question, since you mention:

I really don’t want to have two separate strategies/programs with the only difference being the IP addresses.
If that’s the main problem you’re trying to solve, then what if you have each “master” R2 (the R2 running the strategy) in the cabinet connect directly (e.g. via ETH2) to that second R2? Does anything else besides the master need to see that other R2?

If you could arrange it so the answer is “no, only the master R2 needs to see the other R2,” then your strategies could easily be identical. You’d just have your own little local secondary network in each cabinet with addresses like, perhaps: 10.0.0.1 for the master R2’s 2nd port and 10.0.0.2 for the other R2. That 10.0.0.2 would be the only IP address in that strategy master’s R2 strategy.

Do you see what mean here?


#3

I believe so. Connect the second R2 to the master R2’s secondary Ethernet port? Then I can use the same IP for the second R2 in both cabinets. I would still need two different IPs for the master R2s though.

Thanks.


#4

Yes! And you’re right, the master R2s on the same network would still be different IPs. But both of those “control Engines”/IPs could be in the same strategy, they’d just different in which one is “Active.”


#5

correct me if i’m wrong here, but wont connecting R2(2) to the R2(1) secondary port with a different subnet result in the embedded pc not being able to see R2(2) and therefore the I/O gathering program will not function?
if the program on the pc is only relying on R2(1) then this will work but the way i read the first post is that the pc needs to communicate directly with both R2’s.

just throwing it out here (not sure if it would work) but if you had 2 routers with static WAN addresses on the ‘master’ pc network, you could use the port forwarding function in the routers to communicate with the R2’s on the LAN side. ie, port forward 22001 to R2(1)'s port 22001 and 22002 to R2(2)'s port 22001 (likewise with mmp port). then when configuring the R2’s of cabinet one on the master PC, you would configure them with the same IP addresses but with different control engine ports. this way the embedded pc and R2’s still work locally in the cabinets as they are and you should be able to communicate with the master PC as well without altering the original setup.

does that make sense? sounds like it makes sense, just need to test it in practice…


#6

You’re right about the PC needing to communicate with both R2s, but I could mirror the second R2 to scratchpad registers in the primary R2. I don’t know if I can use the second Ethernet port though. I gather that’s a feature that’s defined in PAC Control Professional whereas I just have Control Basic.

That’s what I was thinking about the router. Each cabinet has a router with a static WAN IP address. On the local side (of the cabinet), the embedded PC and R2s can run the same programs. On the WAN side, the external PC references the router’s IP using one port for the primary R2 and another port for the second R2. The router would forward those packets to the appropriate R2 address and port.

Any ideas about what make/model router I can use?

Thanks.


#7

I’ll leave the router make/model option questions to others. I’m still hoping you could avoid adding more hardware into the equation, but I have made some assumptions.

I was assuming the PC doesn’t need to DIRECTLY access those other/second R2s. Did I understand correctly that the PC only needs to talk to both “master” R2(1)s in each panel? Not all 4 R2s? You could get the I/O info of the other/second R2s by tag name reference in the chart-running R2(1)s.

Also, you do NOT need Pro to just change some IP addresses and connect a cable directly from the ETH2 of the R2(1) to the other R2 (doesn’t matter which port, but ETH1 is probably easier). You DO need Pro for our “redundancy” feature, but that’s not what we’re talking about here.

Maybe some pictures would help.

This image is from our [B][U]Networking Guide[/U][/B], which may also be helpful:


In the topology I’m suggesting (where you don’t need any more hardware), the “control network” would just be the cable between your “master” R2(1) and other R2(2):


On the “master” R2(1), which the PC can see over the green “computer network,” you’d just configure the ETHERNET 2 interface in the Status Write area via PAC Manager. Let’s say that’s 10.0.0.1:


Then in your strategy, which runs on the R2(1)s, your I/O configuration would just be 10.0.0.2:

That’s the IP address you’d assign to BOTH R2(2)s, just on ETH1 like normal. No need to use ETH2 on the R2(2).

You can change the IP on those R2(2) in PAC Manager too, like so (subnet here would also be 255.255.255.0:


Make sense?


#8

router models i’d look at would be moxa. theyre pretty rugged and robust. most models come with redundant power supply options. edr-810 give you 8 ports (so you can do away with your switch) and will probably have way to many functions, but its industrial grade. if industrial isn’t an issue then go for something like a netgear wnr2000 or similar. personally id stay away from d-link (bad experiences stick…) but any off the shelf cable router would do the trick. most would have a WAN port and 4+ LAN ports with the functions you require.

what mary suggests above would work with pac basic. then you would do your mirroring of R2(2) scratchpad area to the R2(1) and your away. the only problem i can see with this is that you would lose the ability to mmp directly to R2(2) once you have this setup in place (unless you keep the switch and configure R2(2)'s eth2 port to plug back into the switch, but then you’d have pretty much what you just had with an extra link between the R2’s, but this now gets too confusing…).
so if you wanted to use pac manager to inspect R2(2), you can’t. you can use pac control and in debug inspect the R2(2)'s I/O and check on some simple things, but any hard core configuration would require some extra effort.

maybe a new pac manager feature would be to have a pass through to a secondary network (on eth2) similar to the serial pass through? that way you could pac manager into snap ethernet brains that are segregated from the main network.

i hope this helps.


#9

Thanks. I appreciate the ideas. I’ll let you know what I come up with.


#10

Sorry to dredge up an old thread.

I’m trying out a B&B Electronics SpectreRT router. I’ve got two racks, both with EB2’s. One is set at 10.200.1.10 and the other is 10.200.1.11. I also have a Windows computer (10.200.1.5) and a serial server (10.200.1.65). The private port of the router is set to 10.200.1.1. All are connected to a 5-port Ethernet switch.

The public port on the router is set to 10.10.1.69 (my office subnet) and is connected to a WiFi bridge.

I’m using the router’s NAT table to forward packets from a public port to a private port of a specific address.

Since B&B sent me a sample configuration for Modbus, I decided to try that.

First, I installed a Modbus master on the local computer (10.200.1.5). I was able to connect and read data from the racks. So far so good.

Next, I set up a NAT entry in the router. Public port 502, private port 502, TCP, address 10.200.1.10 (the first rack). Using the same master program on my office computer I tried to connect to the router 10.10.1.69 port 502. I didn’t connect.

As a test, I installed a modbus slave on the local computer (10.200.1.5) and changed the NAT entry above to address 10.200.1.5. This time I was able to connect and exchange data with the modbus slave from my office computer.

Another test, I added another NAT entry to forward data on public port 4000 to private port 4000, address 10.10.1.65 (the serial server). Using a TCP terminal program, I was able to connect to the serial server from my computer.

I am so close I can taste it. I was able to setup port forwarding so that I could connect directly to the local computer and the serial server from my office computer. I just can’t connect to the EB2s.

Is there anything I’m missing? Any help would be appreciated. Thank you.


#11

Sounds like it’s time for Wireshark. Have you tried sniffing the packets at all yet?


#12

Joey
Check your gateway. it smells as tho the gateway in the eb’s isnt configured or looking elsewhere. Pac manager to the eb’s and jut make sure your gateway is configured to 10.200.1.1 (or whatever address yr router is).
Hopefully this solves it
Nick


#13

Got it! Nick, you were correct. I did not have the gateway set in the EBs. After I set it (to 10.200.1.1, the private address on the router), I was able to connect to both EBs from the public side using PAC Manager, Modbus, and the .NET class library. I did find it odd though that the protocol PAC Manager uses is TCP. I thought it used UDP.

Anyway, it’s all good! Thank you very much!