Author Topic: Twincat driver add route manually  (Read 4188 times)

bobobo

  • Newbie
  • *
  • Posts: 19
    • View Profile
Twincat driver add route manually
« on: October 07, 2015, 12:00:46 PM »
Hi
I am using the Twincat driver with Adv.HMI 3.99a.
It is working only if i disable all network interfaces except the one connected to plc. Sometimes it works when Wi-fi is enabled also, but Virtualbox and different VPN drivers have added more network interfaces to my system.
Also in the past (older versions of Adv.HMI), I have had a lot of trouble getting AdvancedHMI to set-up the routing properly.

I think it would be great to have a possibility to disable any attemts from Adv.HMI to set-up a route automatically and do it all manual.
The proposal would be to add a Manual/Auto route setup to the properties of the TwincatCom Control.
Then also a "AdvHMI AMSNetId" property where I put in the desired AMS id of the HMI computer.

Then I just use another computer with Twincat system manager to add a route in the plc with the AmsId and ip-address of the HMI computer.
Beijer Eletronics HMI panels work this way.

It is some more set-up work than a fully automatic route set-up, but it's less work than trial-n-error to get a "not always automatic" function to work....

Best Regards

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Twincat driver add route manually
« Reply #1 on: October 07, 2015, 10:04:26 PM »
If you leave the UserName property blank, it will not attempt to add the route.

bobobo

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Twincat driver add route manually
« Reply #2 on: October 08, 2015, 03:48:30 AM »
OK
But how can I know the AmsId of AdvancedHMI?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Twincat driver add route manually
« Reply #3 on: October 08, 2015, 04:20:21 AM »
OK
But how can I know the AmsId of AdvancedHMI?
This may be a little tricky. The logic is:

1) Check registry for HKEY_LOCAL_MACHINE\Software\Beckhoff\TwinCAT\System\AmsNetId
2) If not in registry, get list of IPv4 addresses on PC. Use first IP address where first byte matches that of TwinCAT target IP
3) If unable to get an IPv4 address, then take last 3 bytes of MacID and ccreate 99.b3.b4.b5.1.1

So the best way to definitely know is to use RegEdit to create the key and value. If you open RegEdit on a machine with TwinCAT installed, you will see the same key created when TwinCAT was installed.