Author Topic: A guide to using AdvancedHMI with ABB AC500 via ModbusTCP  (Read 9500 times)

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
A guide to using AdvancedHMI with ABB AC500 via ModbusTCP
« on: June 12, 2015, 12:35:07 PM »
A guide to using AdvancedHMI with ABB AC500 via ModbusTCP

This was tested with:
Automation builder 1.1.0.835
AdvancedHMI 3.98g
PM554-ETH CPU.

I will just assume that you already have a project and controller set up in Automation builder.

1. In Automation builder, doubleclick "Protocols" in the treeview and click the button "Add protocol.." in the window that pops up.
2. Add the protocol "Modbus TCP/IP Server"
3. Doubleclick the newly added "Modbus_TCP_IP_Server" in the treeview.
4. Tab "Modbus TCP/IP Server Settings" - Set server connections to the number of connections that you want to be able to have active at any time.
5. Tab "Modbus Server Settings" - Choose what type of memory you want to read via Modbus (%M or %R). If you want to use variables with retain, choose %R.
6. Done! Start programing!


To be able to read/write variables via AdvancedHMI, you need to assign the variables to memory (either %M or %R, depending on what you configured the protocol for)
Here's an example of a global variable list:


VAR_GLOBAL

Bit0 AT %RX0.0.0: BOOL; (* 00001 *)
Bit1 AT %RX0.0.1: BOOL; (* 00002 *)
Bit2 AT %RX0.0.2: BOOL; (* 00003 *)
Bit3 AT %RX0.0.3: BOOL; (* 00004 *)
Bit4 AT %RX0.0.4: BOOL; (* 00005 *)
Bit5 AT %RX0.0.5: BOOL; (* 00006 *)
Bit6 AT %RX0.0.6: BOOL; (* 00007 *)
Bit7 AT %RX0.0.7: BOOL; (* 00008 *)
Bit8 AT %RX0.1.0: BOOL; (* 00009 *)
Bit9 AT %RX0.1.1: BOOL; (* 000010 *)
Bit10 AT %RX0.1.2: BOOL; (* 00011 *)
Bit11 AT %RX0.1.3: BOOL; (* 00012 *)
Bit12 AT %RX0.1.4: BOOL; (* 00013 *)
Bit13 AT %RX0.1.5: BOOL; (* 00014 *)
Bit14 AT %RX0.1.6: BOOL; (* 00015 *)
Bit15 AT %RX0.1.7: BOOL; (* 00016 *)

Word0 AT %RW0.0: WORD (* U40001 *)

END_VAR



Note 1: Function code 0 can be used for both reading and writing bits, and function code 4 for reading and writing words.
Note 2: Bits and words overlap. This means that the 16 bits in the above example are the 16 bits of the word.
Note 3: The addressing of the bits and words are offset by 1 when using AdvancedHMI (compared to the manual from ABB)
Note 4: The words are unsigned (0-65535). This means that you need to use the prefix "U" when reading/writing them with AdvancedHMI.


Sidenote: If you want to use variables with retain/persistance, don't forget to configure what part of the memory that should be persistent. This is done by doubleclicking the CPU in the treeview and setting a value for the "End PERSISTENT %RB.x". Note that the column Parameter says "byte", and Type says word (!) Don't ask which it is..

This should also work with the bigger CPU's and ModbusRTU if you have one without ethernet (eCo-versions doesn't support ModbusRTU).

215

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: A guide to using AdvancedHMI with ABB AC500 via ModbusTCP
« Reply #1 on: October 20, 2016, 11:17:09 AM »
Is this guide still valid.

I've tried this exactly, on the same hardware, but the HMI isn't able to connect to it.
I am able to ping to the IP address.

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: A guide to using AdvancedHMI with ABB AC500 via ModbusTCP
« Reply #2 on: October 21, 2016, 12:24:32 AM »
It should work fine, I've deployed 2 HMI's this way.
I have a new CPU that I ordered 2 weeks ago, I'll give it a try with the latest version of AdvancedHMI when I get the time.
I'll post the program for the CPU and the AdvanvedHMI solution here.

Stupid question; Is the CPU in run when you test it?

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: A guide to using AdvancedHMI with ABB AC500 via ModbusTCP
« Reply #3 on: October 21, 2016, 02:24:31 AM »
Just tried with the following:

AdvancedHMI 3.99r
Automation Builder 1.2.1.3306
PM554-ETH CPU

It worked without any problem. I've attached the program for the CPU that I tested with. Can't attach AdvancedHMI since the zip is too large.

215

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: A guide to using AdvancedHMI with ABB AC500 via ModbusTCP
« Reply #4 on: October 21, 2016, 04:49:03 AM »
I guess I will try your solution..
It is run mode, I am able to change the variables "On the fly"..
I able to ping to it, but can't make a modbus master (modpoll or AHMI) communicate with the server (slave)..  It keeps going into timeout.

Here is my project for reference: https://www.dropbox.com/sh/ft4p5me182qjcro/AABy2XjI2QukPsN90ZxWgICUa?dl=0

I guess I will try your solution and see if it works, and report back with my newly gained knowledge.

Friedrich

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: A guide to using AdvancedHMI with ABB AC500 via ModbusTCP
« Reply #5 on: October 21, 2016, 08:11:14 AM »
Gave your program a try with the %M instead of the %R that I used. It worked as well, so your problem is most likely what you do in AdvancedHMI.
Here's the one I made, try it: https://www.dropbox.com/s/036xh2g8376cer8/AdvancedHMI%20389r.zip?dl=0

215

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: A guide to using AdvancedHMI with ABB AC500 via ModbusTCP
« Reply #6 on: October 21, 2016, 03:21:15 PM »
I solved my issue..
The problem was in codesys, you are able to define the port of the server in there, but somehow is that port you set not the one used for modbus, I was able to ping the ip adress with the given port number with telnet without any problems.
I tried different ports and ended up having a connection established on port 502 which incidentally is also set as the standard for modbus..

I am still confused on what codesys is doing using 1200 (the other port number).. but hey it works..

thanks for your help -  And sorry for questioning the validity of your guide.  It still works.