AB7900 data exchange between PLCs

I am using an AB7900 between two Lenze C300 PLCs, which are Codesys based.
I used the Anybus Configuration Manager to set the Input PDO Size, Output PDO Size, Input SDO Size, and Output SDO Size to 256 each.
Then I used the HMS EtherCAT ESI Generator to create an .xml file which I have installed in the PLCs’ programs.
The AB7900’s status on the EtherCAT bus of both PLCs is “Running.”
The AB7900’s GW Status lamps and Run lamps are solid green on both sides, and the L/A1 lamps are flashing green.
I have a laptop connected to each PLC so I can monitor in real-time the data exchange between the two PLCs. I have tried writing data to both Input and Output registers on both PLCs, and I can see the data on the PLC where I write it, but I do not see it being received by the other PLC.
Is there something I need to do to move the data from the Output registers of one side to the Input registers on the other side of the AB7900?
Is there something with the configuration that I need to be correcting?

Hello @Nathaniel,

It sounds like you have the gateways configured and running correctly and i dont see anything obvious wrong. It sounds like the devices are connected to separate interfaces and both are in RUN mode. Do you have the control/status word enabled? Are you using SDO’s or PDO’s? Typically I see the SDO set to 0 and only PDO’s used.

Keep in mind the data is swapped between the top and the bottom interfaces. data written to the input data will be output on the other side.

Hi Deryck, thanks for your help. I have tried a number of different configurations including PDOs and SDOs, as well as SDOs set to 0 and only PDOs used. I have tried configuring with 20 bytes, 120 bytes, 256 bytes, 512 bytes, each with both Control word/Status word Enabled and Disabled. I have tried writing data to both Input registers and Output registers on both PLCs. No luck yet.
I have not tried doing anything with “Advanced” or “CoE init commands” tabs on HMS EtherCAT ESI Generator, as I am not sure what to do there.
Also, I’m not sure where to look to see the Control word and Status word in the PLC.

I noticed in the X-gateway Interface AddendumEtherCAT Slave, page 4-14:
“Note 1: For consistency reasons, PDO data will be read-only when accessed acyclically.”
Is there something I need to be doing differently to account for this?
I have tried selecting “OpMode” “DC” under the “Advanced” tab in HMS EtherCAT ESI Generator, but this makes the EtherCAT bus fail.

Hi Nathan, The control word is enabled and disabled in Anybus Configuration manger.

I am not familiar with Codesys so I’m not sure if you could be skipping something on that side. If you can get a wireshark we might be able to look at that to get a better idea what is going on.

Deryck

Hi Deryck, yes, as mentioned I have configured the Control Word and Status Word in Anybus Configuration Manager to be both enabled and disabled. However, I was not seeing where they were located in the PLC. Turns out they are bytes zero and one of the Input and Output registers.

This leads to the real issue, which is not seeing any values update on either PLC, in either the Input or Output registers. When Control Word and Status Word are enabled, I would expect to see at minimum the values in bytes zero and one of the Input/Output registers to change to reflect Control and Status, correct? I am seeing nothing change in the PLC registers.

I am a beginner at WireShark, but I was able to connect and see data scroll by.
For example, if I look at EtherCAT datagram: Cmd: ‘LRW’ I can see:
“Data: 7003000000000000000000000000000000000000”
As it scrolls, the 7 is replaced by other numbers, but the rest of it remains the same, no matter what I write into different Input and Output registers of the PLC.
I’m guessing that “7003” represents the Control Word or Status Word?

Can you share the capture with me? This looks most likely like data is being exchanged but I do not have enough context to say what this data is.

Where are you taking the capture from? How is your network setup and how many devices? Are you mirroring the port or taking it directly on the PC running Codesys.

Deryck

Hi Deryck, I have attached the capture, along with screenshots of what the Anybus looks like inside the PLC environment. These are pics from PLC A, so they are the nearest to the WireShark sniffing point.Anybus Tester.zip (695.9 KB) You should be able to compare the data you see in the capture with the data in the PLC pics (especially “PLC EtherCAT 5.png”) and notice that the Control/Status words are not updating accordingly.

Setup:
-PLC A EtherCAT Port to Unmanaged Switch
-Unmanaged Switch to Anybus Top Interface
-Anybus Bottom Interface to PLC B EtherCAT Port
-Laptop A with WireShark to Unmanaged Switch to sniff EtherCAT
-Laptop B to PLC A or B Ethernet Port as needed (one at a time, directly)
-No other devices connected on Unmanaged Switch, EtherCAT buses, or Ethernet buses

Hi Deryck, analyzing the number I saw on WireShark:
“Data: 7003000000000000000000000000000000000000”
Looking at the first 4 digits:
-“7” is the sum of bits 12-15 (Gateway Cycle Counter), and is cycling through as though counting
-“0” on left is the sum of bits 8-11 (General Error Counter), indicates that no error is present
-“0” on the right is the sum of bits 4-7 (reserved)
-“3” is a sum of bits 0-3 (Run, Init, Master Mode), indicates that Run = 1 and Init = 1 (Master Mode does not apply)

Per the Anybus X-gateway User Manual, section 2.3.1:
-Init Bit set (1) = Other network interface successfully initialized
-Run Bit set (1) = Other network online and exchanging data

Therefore, it sounds like the Anybus thinks it is working correctly.
Since I can’t see anything updating in the PLC, perhaps the ESI file is not configured correctly?
I’m not sure what I need to look at there.

Hi Deryck, I noticed some problems with the XML files generated by the HMS EtherCAT ESI Generator.
First, every address is configured as Read-Only:
< Access > ro < /Access >
Second, there are no configured addresses in the ESI files available for download from Anybus’ website. This explains why they did not work initially.

I am not an ESI/XML expert, but it appears that the configuration of the ESI file is what is causing the issue with the PLC not being able to correctly talk to the Anybus. Is there anyone on staff at HMS that can look at this?

Thanks,
Nathaniel

Hi Nathaniel,

This matches what I can see in the wireshark. We can see the the working count increase indicating it has passed though nodes.

Can you share the ESI file you are using? Ill look it over and test it with a setup in our office Monday.

Deryck

Deryck

Hi Deryck, one of the Lenze Codesys/EtherCAT experts looked at my setup today and pointed out the error of my ways. There is a setting in Codesys, under the Anybus EtherCAT slave device:
“EtherCAT I/O Mapping” tab
“Always update variables:” (bottom right corner)

  1. “Use parent device setting” (default)
  2. “Enabled 1 (use bus cycle task if not used in any task)”
  3. “Enabled 2 (always in bus cycle task)”

Setting this to option 3, “Enabled 2 (always in bus cycle task)” fixed the problem.
So my comments about the ESI/XML file are incorrect.
I tried configuring the Access to both “rw” and “ro” and they both work with the above fix.

I apologize for leading down the wrong path.
It appears to be working correctly now by using a correctly generated XML file using the HMS EtherCAT ESI Generator application (no additional modification required).

Thank you for your assistance!

Hello Nathaniel,

Glad to hear you have it working correctly.

Regards,
Deryck