1

I'm new to EtherCAT/TwinCAT. I have a slave device connected to Master. I can read data with an ADS Client from the slave device if I create a variable in my PLC and link that variable to a value on the slave. Is there a way to get a value from the slave without having to create a PLC variable? I'd like to be able to read and modify multiple objects on the slave without having to create a variable for each in the PLC.

Vic
  • 55
  • 7
  • In principle ADS is not restricted to read/write plc variables. With ADS, functions/data are identified with AMSNetId,AMSPort,Group and Offset and this allows for much more than just read/write plc variables. For instance, in addition to read/write plc variables I retrieve information about plc variables, set/get all kinds of states, retrieve version info and do all sorts of stuff with axes. However I don't think ADS allows for what you want, please have a look at; https://infosys.beckhoff.com/content/1033/tc3_ads_intro/index.html Can you tell more about what you are trying to achieve? – owillebo May 16 '21 at 09:46
  • Hardware that will be controlled through the TwinCAT master will be developed in isolated sub-systems and then integrated together. Most of the control of these sub-systems and the system as a whole will be done through a separate program, not through PLC logic. So, for the most part, we are using the EtherCAT fieldbus as a means to control hardware from our program. The hardware configuration of the sub-systems will likely change / be shared between sub-systems in the future. – Vic May 16 '21 at 20:25

1 Answers1

2

In order to enable this functionality all you need to do is Enable ADS Server on the EtherCAT device that you are trying to access.

Making ADS IO symbols available

There are a few setup steps that are required to make this work, but it is reasonably straight-forward.

  1. Scan in IO from EtherCAT chain
  2. Add a new 'Twincat Task with Image'
    • Added from the context menu of 'System>Tasks'
  3. Create and link variable from added task to IO
    • Force the sync-unit updates and allow control of EtherCAT timing
    • I added a variable that linked to the SlaveCount with a UINT, very basic
  4. For EtherCAT master enable 'Enable ADS Server' and 'Create Symbols'
  5. Access Symbols as you would any other on the controller
    • Only oddity around this is that you need to access the CONTROLLER net ID, not the EtherCAT master, But you still use the port from the EtherCAT master

Where to find 'Enable ADS Server', 'Create Symbols' and ADS Port

Enabling the ADS Server


Example Symbol path in the IO device list

Symbol path as shown in XAE

Steve
  • 963
  • 5
  • 16
  • I've enabled the ADS Server and Create symbols on the device. I can read / write to the devices now, but the only way I was able to do this was use the symbol loader to find the devices and their index groups and index offsets; they don't match the ADS info of the devices shown on their variable tab. The index offset matches the Address of the device but I can't find where the index group comes from. – Vic May 17 '21 at 01:16
  • @Vic I'm not entirely sure what the issue is with your accessing. I have been able to access the symbol data with no major concerns. Create Tasks with Image -> Link to a generic IO -> Activate system -> ADS connection to controller and port. I've updated my answer to try and make the flow clearer but will need review. – Steve May 17 '21 at 04:31
  • I setup my project as you described and it works! I can read and write info using the ADS info or the Symbol info. The strange thing is I went back to my old project and then was able to read and write without changing anything. Can't figure out what happened, but it's working now. Thanks! I accepted your answer, but am unable to give you an upvote. – Vic May 17 '21 at 17:02