Author Topic: String over Modbus TCP/IP  (Read 7873 times)

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
String over Modbus TCP/IP
« on: August 16, 2014, 10:30:52 AM »
Hi
Has anyone get datatype string moving over modbus tcp/ip from controller to AdvancedHMI?
How did you done it?
Purpose is get system alarms in readable mode for operator.
My controller is Beckhof CX8090.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: String over Modbus TCP/IP
« Reply #1 on: August 16, 2014, 05:06:08 PM »
Have you tried using the TwinCatCom driver?


.......after I posted, I saw your other thread. I have used the TwinCAT driver with a CX8090 and it works with some computers but not others. It's almost as if it filters certain MAC addresses.

What problems do you get? Are you using the latest version of AdvancedHMI?
« Last Edit: August 16, 2014, 05:10:00 PM by Archie »

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: String over Modbus TCP/IP
« Reply #2 on: August 18, 2014, 01:54:51 AM »
Hi Archie
I have latest AdvancedHMIBeta363. I get it today. (I normally dont touch even with long stick enything where reads BETA.)
No working.
With Target IPAddress comes next info
"No responce from TwinCat (Get symbolinfo)"
With no Target IPAddress comes next info
"SendData Connection Failed-No connection could be made because target machine actively refused it 192.168.0.21:48898"
IP addres is PC with AdvancdHMI.
AMS address is OK.
There is no TwinCat evernever installed in PC with AdvacedHIM
I dont have any user name or password in cx8090.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: String over Modbus TCP/IP
« Reply #3 on: August 18, 2014, 09:11:16 AM »
For TwinCATComm, make sure you have these property settings:

aTargetAMSNetID : set to the AMS ID of the CX8090 (will be something like 5.32.24.50.1.1)
TargetAMSPort : 801
TargetIPAddress : IP Address of the CX8090
UserName : Administrator
Password :  (leave this blank)


Open a command prompt window and try to ping the CX8090 just to make sure the PC can see it.

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: String over Modbus TCP/IP
« Reply #4 on: August 19, 2014, 02:45:48 AM »
Hi
It wont help.
My indicator lamp say same
"No responce from TwinCat (Get symbolinfo)"
And Immendiate Window come next messages:
A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in MfgControl.AdvancedHMI.Drivers.dll
A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in AdvancedHMIDrivers.dll
BUT
When I change in TwinCatCOM properties "Use static route" from False to True in indicator lamp come text:
"SendData Connection Failed - Index was outside the bounds of the array"

And Immendiate Window come next messages:
A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in MfgControl.AdvancedHMI.Drivers.dll
A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in AdvancedHMIDrivers.dll

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: String over Modbus TCP/IP
« Reply #5 on: August 19, 2014, 05:03:23 PM »
You may have the same problem I had with the CX8090. When I ran AdvancedHMI from a touchscreen it would not work, but if I ran the same application from my laptop it would work. I swapped it out for a CX5010 and everything worked fine.

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: String over Modbus TCP/IP
« Reply #6 on: August 20, 2014, 12:09:12 AM »
OK
ModBusTcpCom is working better for me.
I need ADVHMI work in any PC, not only lucky PC.
So, the original question.
The data type string.
Do I have write code to advhmi like:
If textbox1 =1 then
textbox2 :="Help needed"
else tetbox2 :=""
end_if

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: String over Modbus TCP/IP
« Reply #7 on: August 20, 2014, 08:44:40 AM »
The modbus drivers don't support reading strings directly. You can use a MessageDisplayByValue and point it to an integer value, then set the messages that correspond to each integer value.

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: String over Modbus TCP/IP
« Reply #8 on: August 20, 2014, 11:57:57 PM »
That what I worried about.
So I need to start my first Visual Basic lessons...

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: String over Modbus TCP/IP
« Reply #9 on: August 22, 2014, 09:31:54 PM »
I had the opportunity to revisit these CX8090 problems. I did a operating system image update to version 353e and now AdvancedHMI connects quickly without any issues.

You can download this update from here:

ftp://ftp.beckhoff.com/Software/embPC-Control/CX80x0/CX80xx/

You have to extract the files, then remove the MicroSD from the CX8090 and copy the files to it.
« Last Edit: August 22, 2014, 10:03:59 PM by Archie »

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: String over Modbus TCP/IP
« Reply #10 on: August 25, 2014, 01:30:02 AM »
Hi Archie
Now sounds good.
Is the "Hard Disk" folder place to copy new files in MicroSD-card?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: String over Modbus TCP/IP
« Reply #11 on: August 25, 2014, 07:00:37 AM »
Is the "Hard Disk" folder place to copy new files in MicroSD-card?
It would be the Hard Disk if you were looking within the Windows CE environment. I remove the MicroSD card from the CX8090 and use a USB card reader and copy the files to the top level directory of  the card.

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: String over Modbus TCP/IP
« Reply #12 on: August 26, 2014, 02:45:46 AM »
Hi Archie
I made as you made.
I copied files in root of sd-card and ower write existing files.
(Before that I made copy of original sd-card and testing system. OK.
Then  I copy new files into new sd-card.)
CX dismissed from system manager and did not answer to ping. I tryed ping with another PC
and no response.
I tryed to config TwinCat system from windows toolbar icon, but no affect.
Then I reboot the PC whit TwinCat and after that System Manager found CX
and everything OK again.
I/O-signals works with ADVHMI.
Data type TIME is my first thing to get work. After it comes INT, BYTE, WORD etc.
Great, that You have done this, and share it with all of us. Thank You!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: String over Modbus TCP/IP
« Reply #13 on: August 26, 2014, 05:48:24 AM »
I copied files in root of sd-card and ower write existing files.
(Before that I made copy of original sd-card and testing system. OK.
Then  I copy new files into new sd-card.)
CX dismissed from system manager and did not answer to ping. I tryed ping with another PC
and no response.
I tryed to config TwinCat system from windows toolbar icon, but no affect.
Then I reboot the PC whit TwinCat and after that System Manager found CX
and everything OK again.
One to thing note for anyone doing this. When you update the image, it will reset the CX back to it's default name "CX-******" and the IP addresses will be set back to DHCP.

KariM

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: String over Modbus TCP/IP
« Reply #14 on: August 26, 2014, 09:35:25 AM »
Yeah
That's the reason the explicit description of the events so that people do not panic for nothing.
I beleave that I am not only one that start use TwnCatCom driver with cx80xx devises.