Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Friedrich

Pages: [1]
1
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).

2
Support Questions / 3.6.8 DF1 crash when opening multiple forms
« on: September 02, 2014, 02:45:00 PM »
There seems to be a problem with the new 3.6.8 and having two windowforms with the DF1 driver.
When you open the second form the program crashes.
If you don't read anything on the second form it doesn't crash, so it seems to be a conflict with the com. between the two forms. Everything works with 3.6.1.

3
Support Questions / 3.61 flickering components
« on: June 30, 2014, 03:25:29 PM »
I've got a problem with some basic indicators/basic buttons that flicker everytime the program reads from the PLC.
I've assigned "PLCAdressVisible" to the buttons, and "PLCAdressSelectColor" to the indicators. All other adresses/options are left blank.
I've read the other threads about people having the same problem, but with pilot lights.
Therefore I have enabled "DoubleBuffered", and the only difference with it enabled is that all the buttons and indicators blinks all at once, instead of each one blinking as they are being read from the PLC.


This is what I'm reading from the PLC and presenting on the MainForm:
B3:0/0 -> B3:0/5
B3:10/0 -> B3:10/5
B3:20/0 -> B3:20/5 (Flickering)
B3:30/0 -> B3:30/5 (Flickering)
B3:40/0 -> B3:40/5
B3:50/0 -> B3:50/5 (Flickering)
B3:60/0 -> B3:60/5
B3:190/0 -> B3:190/6
B3:200/0 -> B3:200/3
B3:213/0
N7:0 -> N7:6

If I try to read any of the bits above that are marked with flickering, every indicator that is true or every button that is "visible" starts flickering.
If I remove them everything is fine. Doesn't matter if I just read one bit, or any one of those.

If I add any of them to another form, all is fine. Even when I open that form and have the main form visible in the background.

This is what I've tried/doublechecked so far without any success:
1. Changing PollRateOverride to increase time between reads (btw, it can't be set back to 0 once you've changed it)
2. All the bits being read are configured in the PLC
3. The bits doesn't flicker in RSLogix 500
4. Tried running the program on a panel-pc with a fresh installation of XP embedded
5. Removed the sub that makes the form stop polling when it's not visible
6. Instead of copying components with the troublesome bit-reading, I've added new.
7. Disabled FIFO-buffering on the comport.
8. Forced the program to use only one core of the CPU.
9. Rebuilt the solution
10. Made a new project and just added 3 basic indicators. 2 that read B3:20/3 and B3:30/3, and the last one with visibility if B3:190/0 is true.

If I don't read any bits from B3:0, I can read from B3:20 without any flickering. But I cannot read from B3:20 and B3:30 at the same time. Not even if I remove all readings from all other words.

Everytime the indicators/buttons flicker, Visual studio spams the output with this:
A first chance exception of type 'System.IndexOutOfRangeException' occurred in AdvancedHMIDrivers.dll

My setup:
Win7 pro
Visual studio express 2013
AdvancedHMI 3.61 beta
SLC 5/03 via DF1 (RS232 cable)

Pages: [1]