Ads-Error 0x701 : Service is not supported by server

18 February 2020 at 11:20 am

Article image for Ads-Error 0x701 : Service is not supported by server

For a robotics project I’m currently diving into PLC programming using the TwinCat protocol. It’s very much a different world from what I’m used to, so I’ll relay some of my experience getting started in this post.

​It’s industrial…

Up until now I’ve made the hardware I’ve needed from scratch. I’ve picked the components and microcontroller to use. I’ve written all the code required to control the machine I’m building and I can tweak everything. For a recent robotics project I’m doing for a client, we need to talk to a robot 200m under the sea. Cables are expensive and 200 meters of it is even more expensive, so we want to use an optical cable from the ship on the surface, down to the ROV that is then tethered to our robot. The optical cable will be used for TCP/IP traffic that controls our hardware (housed in the ROV). This means that we’ll need hardware that can be controlled via TCP/IP. Luckily, such a thing exists and is commonly used in industrial automation.

After a lot of fumbling trying to learn the industrial landscape, we’ll use EtherCat motor drivers from Maxon. This way we don’t need to build everything from scratch and since it’s standard hardware, it should be easy to use. Maxon does however not provide any instructions on how to get this up and running, so we spent several weeks researching how we would control our 3 motors deep down in the sea. After a lot back and forth, we settled on using hardware from Beckhoff Automation - the creator of the EtherCat protocol.

Beckhoff is a classical German company. They’re solid and their solutions “just work”. You just purchase modules from them, slot them together and then read up on the documentation. Shouldn’t be hard, right?

It’s documented…?

Every product comes with a series of PDF files that you have to read very carefully since there’s a lot of important information that you “just have to know” to get anything to work. For instance - you cannot just download the latest version of the Twincat software to work with EtherCat. You have to know that your hardware can only use a specific version of the software and there’s no “smartness” built in. The obvious thing to do would be to display an alert saying “to work with this device, you’ll need version 3.1.4022.30 and NOT 3.1.4024.7 since that won’t work. You cannot figure this out by searching the web. You’ll have to call their support department.

  • To reliably talk to the PLC, it’s important that you first enable DHCP, find the IP of the device, login to it’s internal webserver (with default password “1” for all users!?!?!), turn on Remote Screen, change to a fixed IP, set your own PC to an IP in the same range. Easy peasy and everyone should know, right?
  • TwinCat can auto-discover EtherCat hardware attached to it’s bus, but to actually use it you’ll need an ESI-file. For Beckhoff’s own units, they have these available as an automatic download, but for a Maxon motor driver you’ll just have to know that these have to be placed in the folder c:\TwinCAT\3.1\Config\Io\EtherCAT It’s written in the docs (if your Googe-foo is strong enough) or you can call Beckhoff support so they can tell you how to do it.
  • You’re trying to talk to the device too often? Then I’ll just disconnect you at random times without displaying an error. Support won’t be able to help you.
  • You’re trying to pass an invalid parameter? I’ll just throw a generic error so you’ll sit there stumped (Ads-Error 0x706 : Parameter value(s) is invalid)

The list goes on. This has been my “daily struggle” for quite some time now.

It sure looks cool for a Windows CE computer?
It sure looks cool for a Windows CE computer?

Beckhoff is big on PDF files and they have a really ancient-looking documentation website with no Next-button at the end of each page. Instead, you’ll have to locate where you were in the (really long) frames-based navigation you were to figure what to click to get to the next page. Long HTML pages will introduce concepts and show you how to solve simple problems, but when you get beyond the basics, you’ll just have to line up for their phone support. The support is generally good (but certainly not always), but it’s very time consuming to just not have better online documentation. I understand that it’s hard to document something that can be used to build almost anything, but I think an effort should be made to make getting started easier by improving documentation. It’s fascinating to note that Beckhoff offer expensive courses on how to use their software, but has practically no online training on Youtube or other sites. This is a very ancient way to do business.

You now expect to be able to find solutions online and sharing knowledge is key to surviving. As an example: what I could find on Youtube is mostly from engineers making videos while they were temporarily unemployed. Without these I wouldn’t have a single idea where to get started since Beckhoff’s own Youtube channel is just a series of videos from trade shows? All their content is focused on existing users. There’s nothing there to get you started as a beginner such as “Setting up and connecting to your new PLC” or “Set up automation with Beckhoff tools”.

The Twincat software is a closed source DLL, so if your program crashes you can’t really understand why. Case in point - the error in the title (Ads-Error 0x701) has nothing to do with any server (as the error message says). I got this since I tried to apply a listener for state changes using AdsStateChanged. Apparently that’s not possible, but since the error happens inside a closed DLL and the Beckhoff website only list the error codes that you’ll get in Visual Studio, you won’t get any help there. A well built documentation will contain examples/explanations of what has gone wrong. In this case, I’m 99% sure that this error is just triggered randomly since it’s not captured properly anywhere else, but it’s very odd to expose handlers that you shouldn’t use?

So how should one use AdsStateChanged then? Well, the entire documentation for the library is just the JavaDoc output. There are no examples and just very brief textual explanations of parameters that usually just repeat the name of the parameter (as in “nIndexGroup” being documented as “Index Group” without explaning what Index Group actually does).

You’re just being negative…

No I’m not. The world has moved on and this is an old style company. I love learning new tech, but this is too much uphill for my taste. Every day for 3 solid weeks has been getting a little further and then hitting a new wall. All I am trying here is to use their products. It shouldn’t be hard to get started. It should be hard to solve problems, but not to make the darn thing work at all.

Better documentation alone would provide me a better starting experience. Throw in some introductory videos and I would even know where and how to find help other than calling the support hotline…