Author Topic: Setting up connection between TwinCat3 and AHMI  (Read 5143 times)

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Setting up connection between TwinCat3 and AHMI
« on: July 28, 2022, 11:30:55 AM »
I am trying to setup a test to connect my TwinCat plc program and a test AHMI solution. I have the TwinCat program running on a Beckhoff IPC, and I have the AHMI solution running on a separate laptop. I'm connected via ethernet. I have a route established in-between the laptop and the IPC. I set the IP address on the Beckhoff IPC side to 192.168.100.99 and matched that with the AHMI TwinCAT com1. When I go to do a live test or debug on the AHMI side and I go to click on my button, I get an error which says "The write failed, the given key was not present in the dictionary"

What am I missing?

My test button on the PLC side is called "TestButton" which is in a routine called "Test".
On the AHMI side I have tried the variable for PLC click as "Test.TestButton" I have also tried "TestButton" both produce the same result. Do I not have the variable addressed correctly?


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting up connection between TwinCat3 and AHMI
« Reply #1 on: July 28, 2022, 11:34:43 AM »
The AdvancedHMI TwinCAT driver does not play well with TwinCAT being installed on the same PC. It will be necessary to uninstall TwinCAT from your laptop or at least stop the TwinCAT system.

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Setting up connection between TwinCat3 and AHMI
« Reply #2 on: July 29, 2022, 12:12:47 PM »
Ok thank you for the information.

In case anyone here is interested in an alternative solution the future. There is a way around this hang up by using the TwinCat.Ads reference in MS Visual Studio. Using this will allow you to be able to run TwinCat on the programming machine, as well as the PLC and still be able to utilize AHMI at the same time. That being said it will require a little extra background code work for each and every event on your HMI.

Regards

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting up connection between TwinCat3 and AHMI
« Reply #3 on: July 29, 2022, 12:28:57 PM »
V3.99y Beta has a second TwinCAT driver that used the ADS dll. I haven't used it for quite a while, so I can't say how well it works with TC3
« Last Edit: July 29, 2022, 12:47:24 PM by Archie »

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Setting up connection between TwinCat3 and AHMI
« Reply #4 on: July 29, 2022, 12:38:16 PM »
Good to know, thank you! Love what you are doing!

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Setting up connection between TwinCat3 and AHMI
« Reply #5 on: August 16, 2022, 10:49:11 AM »
Archie,

I am continuing my testing to get this TwinCat com and TwinCat program communicating together.

I now have a separate brand new PC dedicated to be able to run the AHMI solution file, it has never had any Beckhoff applications installed on it.

I am running the TwinCat program on a Beckhoff IPC. I am able to ping from the Dell PC to the Beckhoff IPC. However when I try to run my solution file on the Dell I get an error "WriteData2b. ADS Error (GetSymbolInfo)"

I have attached my TwinCat com settings. Which match what the Beckoff IPC is using. How can I get the communication working properly?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting up connection between TwinCat3 and AHMI
« Reply #6 on: August 16, 2022, 11:16:52 AM »
Are you writing to a variable when the error occurs?

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Setting up connection between TwinCat3 and AHMI
« Reply #7 on: August 16, 2022, 12:05:10 PM »
Yes. I am using a test button to write a bool variable of true to the TwinCat side when the button is pressed.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting up connection between TwinCat3 and AHMI
« Reply #8 on: August 16, 2022, 12:54:21 PM »
What do you have in the PLCAddressWrite property?

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Setting up connection between TwinCat3 and AHMI
« Reply #9 on: August 16, 2022, 01:06:04 PM »
I am trying to write to a bool variable called TestButton in a POU called Test.

I have it writing to Test.TestButton on click action.

Do I need to be writing to a Global Variable? Or can I read and write from a POU variable as well as a GVL variable?


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting up connection between TwinCat3 and AHMI
« Reply #10 on: August 16, 2022, 02:52:08 PM »
I think what you have is correct, but try it in a global variable. Try the variable alone, then also try it with a period preceding it.

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Setting up connection between TwinCat3 and AHMI
« Reply #11 on: August 18, 2022, 01:21:56 PM »
I tried all those methods, and still getting the ADS error unfortunately. Any other ideas?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting up connection between TwinCat3 and AHMI
« Reply #12 on: August 18, 2022, 02:38:49 PM »
Can you do Wireshark capture and post it here?

Shark13

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Setting up connection between TwinCat3 and AHMI
« Reply #13 on: August 23, 2022, 09:59:14 AM »
I'm getting it installed today on the PC that will be running the AHMI solution file. I have never used this software, do you have a procedure or set of instructions to get the exact capture you are looking to see? Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting up connection between TwinCat3 and AHMI
« Reply #14 on: August 23, 2022, 10:57:06 AM »
Once you get it installed, you will see it is very easy and intuitive. Just start the capture, then start AdvancedHMI. After you get the error, you can stop the capture and save the file.