Author Topic: Beckhoff Twincat 2 connection  (Read 5611 times)

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Beckhoff Twincat 2 connection
« Reply #15 on: July 09, 2020, 03:33:54 PM »
The list box on the AMS Router tab is always empty, but I don't know if I've ever looked at it while AHMI was running...

I'll try to test that tomorrow.

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Beckhoff Twincat 2 connection
« Reply #16 on: July 09, 2020, 03:35:29 PM »
As I've thought about it further, it occurs to me that the OEM who build the machine may have locked something down. When we asked about remote connections for data, they sent us a brochure and a quote for their custom software package. It was NOT cheap. It wouldn't surprise me if something they've done is breaking things

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Beckhoff Twincat 2 connection
« Reply #17 on: July 09, 2020, 10:16:30 PM »
The first thing AdvancedHMI does it create route entries in both the target and local machines. If you have UseStaticRoute set to True, it creates a permanent route entry.

I don't know of anyway to block it unless there is a firewall turned on blocking remote access to the TwinCAT port number. You can try to temporarily turn off all firewalls to see if that is the problem.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Beckhoff Twincat 2 connection
« Reply #18 on: July 09, 2020, 10:45:00 PM »
I looked up the error code which was bytes 28 and 29 of the data packet. In your WireShark the error is 0x0704 which according the ADS error code table:

https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclib_tc2_system/99079192176427915.html&id=

The error is:

ADSERR_DEVICE_INVALIDACCESS
Reading or writing not permitted.

This is vague to me, so I am not sure why

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Beckhoff Twincat 2 connection
« Reply #19 on: July 10, 2020, 03:04:51 PM »
As an experiment, I made a copy of an old WinXP virtual machine and installed TwinCat2 on it. It came with a sample PLC program, which I got to run by following a tutorial on Beckhoff's website. I then pointed my VS project at the new XP VM and got it to display a blinking light based on one of the variables inside the Beckhoff software. I also found a static route called AdvancedHMI8BE1 in the system control dialog box and in the system manager under System - configuration -> Route settings.

The only trouble I had was that there was a second host-only network adapter on the virtual machine. While that was there, Wireshark was showing traffic on the second adapter and AHMI wouldn't work. Once I deleted the second host-only adapter, AHMI started working. Is there a trick on the Beckhoff side when there are multiple NICs? The Beckhoff PC I'm trying to connect to has 2 NICs. I'm using one of them for these tests but it'll ultimately have to talk through the other that's connected to our wired LAN.

I also asked the OEM if there is a setting on their end that's blocking it. Hopefully there is and they're willing to tell me how to un-block it without paying them for their (very expensive) software.

It looks like the AHMI side is configured properly and that there's something wonky inside the Beckhoff PC.

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Beckhoff Twincat 2 connection
« Reply #20 on: August 03, 2020, 01:04:11 PM »
I heard back from the machine OEM. They asked... "May I know the communication format from your AdvancedHMI to our beckhoff? OBCUA?"

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI