News:

  • September 29, 2026, 08:42:02 AM

Login with username, password and session length

Author Topic: Connecting to the PLC via Ethernet  (Read 34685 times)

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Connecting to the PLC via Ethernet
« on: February 11, 2019, 01:36:19 PM »
Ok, I'm hoping there's something I'm just missing...it is Monday after all.  Can I connect to a PLC that doesn't have the same IP prefixes as my pc? For instance, if I'm on 192.168.0.XXX and it's on 192.168.1.XXX even if we're on the same local network? The way corporate IT has everything done with VLANs, my computer will always resolve to a certain range of IPs because of where the network terminates. The machine terminates somewhere else, so it has a different series of IP addresses. I can't seem to make it work, but I'm a big dummy and I've come begging at the altar of knowledge.

Thanks.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Connecting to the PLC via Ethernet
« Reply #1 on: February 11, 2019, 01:59:46 PM »
The Subnet is not just a physical network, but the Subnet Mask tells you which IP Addresses are on the same IP sub-network.

255.255.255.0 would say that
192.168.0.x is a DIFFERENT subnet than
192.168.1.x
(the ending .0 in the subnet is the "don't care", so the first 3 tuples matter, so the two IP Address are on DIFFERENT subnets!)

255.255.0.0 would say that the LAST TWO tuples are "don't care")
192.168.x.x are all on the same subnet, so
192.168.0.x and
192.168.1.x are both on the same subnet IF the SUBNET MASK for the PC and the PLC are 255.255.0.0.

Since you have an IT department, they SHOULD help you with this.  They probably do NOT want you tweaking THEIR subnet masks (on the PC).

Tell us what your PC's Subnet Mask is (it may even be something like 255.255.252.0, that's what ours is).  We can help you from there.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Connecting to the PLC via Ethernet
« Reply #2 on: February 11, 2019, 02:03:14 PM »
It certainly can work, because if it didn't, the Internet wouldn't work. Broadcasts will not work though, so you may have to manually build the link. The one caveat would be whether you run into issues with gateways and routing. Something has to route the packet to the target device. If that process isn't happening, the PLC will never answer.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Connecting to the PLC via Ethernet
« Reply #3 on: February 11, 2019, 02:30:32 PM »
It certainly can work, because if it didn't, the Internet wouldn't work. Broadcasts will not work though, so you may have to manually build the link. The one caveat would be whether you run into issues with gateways and routing. Something has to route the packet to the target device. If that process isn't happening, the PLC will never answer.

The static IP that I've been given for my PLC from IT is 10.10.114.57. The dynamic IP on my computer (when wired) resolves to 10.10.109.XXX. I need to know how to get these two to connect, or do I have to beg to the IT gods to be given a 10.10.109.XXX static ip address for the PLC?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Connecting to the PLC via Ethernet
« Reply #4 on: February 11, 2019, 02:36:56 PM »
Change your PC's netmask to 255.255.128.0.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Connecting to the PLC via Ethernet
« Reply #5 on: February 11, 2019, 03:37:37 PM »
Change your PC's netmask to 255.255.128.0.

I have a dynamic IP on this computer. So it's set to get all that information automatically. I'll have to get a static IP address to attempt this. This will resolve the issue? The IT is pretty grouchy today.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Connecting to the PLC via Ethernet
« Reply #6 on: February 11, 2019, 03:41:39 PM »
Change your PC's netmask to 255.255.128.0.

I have a dynamic IP on this computer. So it's set to get all that information automatically. I'll have to get a static IP address to attempt this. This will resolve the issue? The IT is pretty grouchy today.

The issue is simply that either you need to be on the same subnet as the PLC (changing the mask would do that)...OR...you need some form of routing function between the logical networks. That could be a physical router, or a virtual routing function in your PC. By far, the easiest answer is to change the net mask. It does sound like you will need to involve the IT Nazis.

Bring a gift. A Scotch that can rent a car is always welcome, but one that can vote might suffice.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Connecting to the PLC via Ethernet
« Reply #7 on: February 11, 2019, 04:03:06 PM »
Tell us what your PC's Subnet Mask is (it may even be something like 255.255.252.0, that's what ours is).  We can help you from there.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Connecting to the PLC via Ethernet
« Reply #8 on: February 11, 2019, 06:10:47 PM »
Tell us what your PC's Subnet Mask is (it may even be something like 255.255.252.0, that's what ours is).  We can help you from there.

Don't yell at me, franji! it's 255.255.255.0. I can't change those adapter settings without getting a static ip from IT, so I'll have to ruin the IT guy's day regardless.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Connecting to the PLC via Ethernet
« Reply #9 on: February 11, 2019, 07:14:08 PM »
I bet you can let your computer request an IP via DHCP, then assign the same static address, but with a subnet mask of 255.255.0.0.  See if you can sneak it past the router.  What's the PC gateway IP address?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Connecting to the PLC via Ethernet
« Reply #10 on: February 11, 2019, 07:47:08 PM »
Don't yell at me, franji! it's 255.255.255.0. I can't change those adapter settings without getting a static ip from IT, so I'll have to ruin the IT guy's day regardless.

No yelling necessary.  Your IT guy should have realized that with a subnet of 255.255.255.0, that your PC could not talk to something on subnet 192.168.1.x when the PC was on subnet 192.168.0.x.  So your original post was correct - it could NOT work.

Make sure you did not mis-understand the IT person.  It could be that there is a sub-range of 192.168.0.x (or 10.10.109.x) that is RESERVED for DHCP (say .2 thru .126), but that you COULD have a STATIC IP on your PLC of (for example) 10.10.109.201 (since it would not conflict with DHCP assigned address range).

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Connecting to the PLC via Ethernet
« Reply #11 on: February 11, 2019, 09:33:44 PM »
And don't forget the Scotch when you ask. Seriously. IT guys live lonely lives.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Connecting to the PLC via Ethernet
« Reply #12 on: February 12, 2019, 04:17:50 PM »
Well, it looks like due to the vlan setups they have here at corporate, they utilize vpn to communicate between the network. They're in the process of setting up a vpn for me, and that should do the trick.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: Connecting to the PLC via Ethernet
« Reply #13 on: March 04, 2019, 02:22:12 PM »
So I got my VPN access, and I can see the C-More HMI that's installed on the machine and connect to it. I cannot see the DoMore PLCs. Over the VPN, my IP address is going to be 10.50.176.XXX with a subnet mask of 255.255.224.0. The PLC's IPs are 10.10.114.57(58) with a subnet mask of 255.255.254.0. What is it I need to do here? I'm drowning in my own ignorance!

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Connecting to the PLC via Ethernet
« Reply #14 on: March 04, 2019, 03:20:56 PM »
With your "PC"'s IP Address of 10.50.176.xxx and a subnet mask of 255.255.224.0 (0xFF 0xFF 0xC0 0x00) means that for something to be on the same subnet as your "PC", the first 18 bits of the IP Address must match it, or
10.50.128.xxx thru 10.50.191.xxx
Sometimes, the subnet is specified as follows:
10.50.128.0/18 instead of
10.50.128.0 with subnet mask of 255.255.224.0

Hence, 10.10.114.57(58) will not be on the same subnet as your PC.