asteroidehk

Is it possible to communicate PLC's with different ip range?

9 posts in this topic

Hello Friends

I have several machines with different ip range everyone, according with the image.

The PLC's are Micrologix 1100/1400 with unmanaged switch's.

I would like to get some tags in the PLC4 (DATA STATION) from every PLC (PLC1, PLC2, PLC3).

Is it posible just with configuration? How can I do that? Or do I need hardware?

I have done this with MSG instruction but with PLC's in the same ip range.

Thanks in advance.

 

 

PLC_Network1.jpg

1 person likes this

Share this post


Link to post
Share on other sites

Whether or not those addresses are in same or different subnet is determined by subnet mask. Ip address is only part of network configuration. It contains actually two addresses: subnet address and node address. Mask tells how the 32bits of IP address are split among those two. If you give more bits to one, fewer bits remain for the other. 

so:

+ if the subnet portion gets more bits, you have have many subnets but each of them will be small (few bits left to address individual nodes in the subnet). 
+ if the subnet portion gets fewer bits, you have have fewer subnets but each of them can be large (more bits left to address individual nodes in the subnet). 

to see this, convert subnet mask into it's binary form:
places with "1" must be on the left (identify bits in IP address that represent specific subnet).
places with "0" must be on the right (identify bits in IP address that represent specific node).

example1: 255.0.0.0 or
 11111111.00000000.00000000.00000000 

only 8 bits used for subnet but many bits available for node addresses. this is used in large networks (internet companies)

example2: 255.255.0.0 or
 11111111. 11111111.00000000.00000000 

16 bits used for subnet and 16  bits available for nodes (large corporations or ISPs)

example3: 255.255.255.0 or
 11111111. 11111111.11111111.00000000 

24 bits used for subnet and only 8  bits available for nodes (small networks, like home LAN, or individual machines)


example4: 255.255.252.0 or

 11111111. 11111111.11111100.00000000 

22 bits used for subnet and 10  bits available for nodes (medium networks etc.).


Some of the basic rules are:
1. in subnet mask all "1" are on the left, all "0" are on the right" - ALWAYS.
2. all nodes in one subnet must have same subnet MASK, because this is used to split correctly IP address into two fields. 
3. all nodes in one subnet must have same subnet ADDRESS (first portion of IP address, bitfield that corresponds to "ones" in mask)
4. all nodes in one subnet must have UNIQUE node address (second part of the IP address, bitfield that corresponds to "zeroes" in mask)


So if all devices in your case have subnet mask such as 255.255.0.0 then all of them ARE in the same subnet (first two numbers of IP match).

If you set mask such as 255.255.255.0 then first three numbers in IP addresses would need to match, and since that is not the case, each system would be a separate subnet. 

And if you have only a handful of such systems but on different subnets and the only node that needs access to all of the systems is PC node (DATA PC), you can leave everything as is and just assign several configurations (ip/mask) to its network card. if your DATA node is a PLC, this will not work. PLCs have very limited resources when it comes to networking. But PCs can have several IP's assigned to same network card at the same time (saves time so one does not have to switch addresses all the time).

 

Btw. i also see often people trying to connect things with different subnet masks... Bad idea. It may "work" in some cases but this is definitely not correct and not guaranteed to work - at least not correctly. It may led to a lot of frustration (connection working only one way, or it is intermittent etc.).

4 people like this

Share this post


Link to post
Share on other sites

If the switch above the "Data Station" was a manged switch, then port forwarding could be configured or "aliased".

1 person likes this

Share this post


Link to post
Share on other sites

We have a lot of PLC's that talk to each other (some are 100 plus miles apart) BUT, as pcmccartney1 says... the subnet mask has to be the same. 

Share this post


Link to post
Share on other sites
On 8/8/2019 at 11:50 AM, Michael Lloyd said:

We have a lot of PLC's that talk to each other (some are 100 plus miles apart) BUT, as pcmccartney1 says... the subnet mask has to be the same. 

yes.. if they are in same subnet. in that case gateway is not needed and can remain null (0.0.0.0)

if the nodes are in different subnets, then network settings of each node need to match their own subnet.

but two subnets could use different mask etc. 

communication from one subnet to another would need router.

Share this post


Link to post
Share on other sites

From the router standpoint.  There are many versions out there.  Our favorite is Secomea SiteManager 1149.  We tend to install in almost every system we ship.  We've used them various methods for remote access.  Either through a gateway and secure cloud access or through customer/site specific vpn access and controlled access control lists inside of vlans.

Share this post


Link to post
Share on other sites

If you setup routing you can talk across many subnets.

Share this post


Link to post
Share on other sites
22 hours ago, panic mode said:

yes.. if they are in same subnet. in that case gateway is not needed and can remain null (0.0.0.0)

if the nodes are in different subnets, then network settings of each node need to match their own subnet.

but two subnets could use different mask etc. 

communication from one subnet to another would need router.

We used the gateway address in everything. Some devices required it. It was a Class B network with a fairly common subnet. It's probably getting close to requiring a different subnet. Come to think of it, they recently moved controls off of the corporate NW so it's probably already changed. Either way, everything is routed, tunneled, and pummeled so the Russians can't get in, unless they want to.

 

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now