Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Evilbeard on February 11, 2019, 01:36:19 PM

Title: Connecting to the PLC via Ethernet
Post by: Evilbeard 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: franji1 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: BobO 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard 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?
Title: Re: Connecting to the PLC via Ethernet
Post by: BobO on February 11, 2019, 02:36:56 PM
Change your PC's netmask to 255.255.128.0.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: BobO 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: franji1 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: Controls Guy 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?
Title: Re: Connecting to the PLC via Ethernet
Post by: franji1 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).
Title: Re: Connecting to the PLC via Ethernet
Post by: BobO on February 11, 2019, 09:33:44 PM
And don't forget the Scotch when you ask. Seriously. IT guys live lonely lives.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard 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!
Title: Re: Connecting to the PLC via Ethernet
Post by: franji1 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.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard on March 04, 2019, 03:29:43 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.

and just for the record, the software requires me to be on the same subnet to connect, right? The IT Network guy I'm talking to now believes I need to have a PHYSICAL connection to the machine. I don't believe that is the case, I just wanted proof.
Title: Re: Connecting to the PLC via Ethernet
Post by: franji1 on March 04, 2019, 04:04:22 PM
and just for the record, the software requires me to be on the same subnet to connect, right?

No, it does not.  But the sub-network addressing must be valid/known.  You can have a PLC on The Internet and the software can connect.  The software uses basic IP Addressing, but the addressing must be known.

If something is not on the PC's subnet, it goes up 1 level to try to resolve the address (e.g. the VPN may be able to route it properly).  But you have to configure the VPN to handle multiple/tiered subnets.  It keeps going up until it can resolve it.  The point being, somebody has to resolve the address.  If the IP Address is not on any subnet, it goes to the gateway of the PC (not the PLC) to resolve the address.
Title: Re: Connecting to the PLC via Ethernet
Post by: Controls Guy on March 04, 2019, 04:56:33 PM
and just for the record, the software requires me to be on the same subnet to connect, right? The IT Network guy I'm talking to now believes I need to have a PHYSICAL connection to the machine. I don't believe that is the case, I just wanted proof.

No, but if you want to talk to something outside your subnet, you need both ends to know the IP of their gateway for external addresses.  Then the gateways may be able to talk to each other directly, or then they'll have their own gateways to be able to try to resolve a path to the other device.  Ask your IT what the gateway addresses are for the subnets containing your PLC and your PC.  You may also need to make a route table entry in your PC.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard on March 04, 2019, 05:20:34 PM
and just for the record, the software requires me to be on the same subnet to connect, right?

No, it does not.  But the sub-network addressing must be valid/known.  You can have a PLC on The Internet and the software can connect.  The software uses basic IP Addressing, but the addressing must be known.

If something is not on the PC's subnet, it goes up 1 level to try to resolve the address (e.g. the VPN may be able to route it properly).  But you have to configure the VPN to handle multiple/tiered subnets.  It keeps going up until it can resolve it.  The point being, somebody has to resolve the address.  If the IP Address is not on any subnet, it goes to the gateway of the PC (not the PLC) to resolve the address.

I was on the VPN, I can connect to and modify the C-More HMI. I can't connect to the Do-More.

Do-More PLC
10.10.114.57
255.255.254.0
10.10.114.1

C-More HMI
10.10.114.59
255.255.254.0
10.10.114.1

My Laptop on VPN
10.50.176.164
255.255.224.0

So Laptop will route packets on the network to and from the HMI, but not to the PLC?  I had the IT Guy flip my port over to the machine network (where I'm in the Phantom Zone), and I can connect to the PLC with a static IP of 10.10.114.100 using DMD. We just can't figure out why DMD and the VPN won't connect to the PLC, while I can connect with C-More and the HMI.
Title: Re: Connecting to the PLC via Ethernet
Post by: BobO on March 04, 2019, 05:24:52 PM
Be sure that the comm link uses the IP address as the link address. Name and node number require broadcasts to resolve the address
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard on March 04, 2019, 05:34:23 PM
Be sure that the comm link uses the IP address as the link address. Name and node number require broadcasts to resolve the address

EDIT: after trying time and time again to get them to show up in netedit both scanning and manually, it finally popped up. I had just restarted my pc. I don't know what has changed. It finally let me manually build the link and connect.

I think BobO said curse words and it worked.
Title: Re: Connecting to the PLC via Ethernet
Post by: BobO on March 04, 2019, 05:39:27 PM
Be sure that the comm link uses the IP address as the link address. Name and node number require broadcasts to resolve the address

I can't even see them via netedit. Would that be caused by the same issue?

NetEdit uses broadcasts to locate devices. If the VPN doesn't pass broadcast traffic, then yes. You can connect to a single device with NetEdit by providing the IP address.
Title: Re: Connecting to the PLC via Ethernet
Post by: Evilbeard on March 04, 2019, 05:51:20 PM
Be sure that the comm link uses the IP address as the link address. Name and node number require broadcasts to resolve the address

I can't even see them via netedit. Would that be caused by the same issue?

NetEdit uses broadcasts to locate devices. If the VPN doesn't pass broadcast traffic, then yes. You can connect to a single device with NetEdit by providing the IP address.

I had to edit my post. I know I'm not the brightest bulb, but I'm still burning. Sorry for the non-issue.
Title: Re: Connecting to the PLC via Ethernet
Post by: BobO on March 04, 2019, 09:07:28 PM
I had to edit my post. I know I'm not the brightest bulb, but I'm still burning. Sorry for the non-issue.

Stuff happens. Glad it's working.