Ethercat ADS variables unavailabe

Hi !
I’m having troubles to configure the Ethercat/ADS integration.
I’ve created a route in Twincat and added my PLC IP and NetID in the Hass configuration file.
HA connects to Twincat with no trouble, I can write variables using ads.write_data_by_name service.

My problem is that HA doesn’t subscribe to every ADS variables :
image
The switches are always unavailable, the sensors are usualy available but sometimes they aren’t !

I have this error in my logs for every unavailable variables :

Error subscribing to GVL.bin4: ADSError: timeout elapsed (1861).

And for instance, if I trie to modify the GVL.bin4 variable value from the services, it works. How is it possible ?

I have a node-RED instance running on the same computer and it does communicate perfectly with Twincat. I don’t think there is conflicts between the two softwares because HA does not work better if I stop node-RED.

Thank’s for your answers :smile:

[EDIT]
After restarting HA :
image
It’s so random, I really don’t understand

1 Like

Hi

Maybe there is a network connection problem?
I’m now experimenting with Twincat 2 & 3 PLC’s on a virtualBox Hassio server.

I notice when everything is up and running, the ADS connection will stop when there is a network problem, and the ADS connection will not re connect untill you restart HomeAssistant.

Unlike MQTT, if the network connection is back, everthing resolves automaticly without you noticing.

Note:
I’m planning to resolve this by sending an Alive Bit to HA , and with automations to restart HA when the alive bit hasn’t changed for a certain time.

Regards

Chris Briers

1 Like

The 1861 error is “timeout elapsed” error. See: ADS Return Codes (beckhoff.com)

Keep in mind that TwinCAT 2 and TwinCAT 3 implement the exact same ADS protocol. Nothing in ADS has changed from Tc2 to Tc3. You can also use WireShark to see ADS traffic or use TF6010 | TwinCAT 3 ADS Monitor TF6010 | TwinCAT 3 ADS Monitor | Beckhoff USA which is a plugin to TwinCAT 3 and allows monitoring ADS traffic specifically from VS/TwinCAT.

1 Like