[etherlab-users] Error flag after requesting SAFEOP

Gavin Lambert gavin.lambert at tomra.com
Thu Sep 27 01:49:32 CEST 2018


EC_WD_ENABLE enables the SM watchdog; it’s a separate thing from enabling the SM itself.  In general you should only activate it on one SM per slave – usually the output SM if the slave has outputs or the input SM otherwise.  If you don’t need the slave to drop from OP to SAFEOP when it loses communication with the master then you can leave the watchdog entirely disabled – though using the watchdog is usually recommended for output slaves for safety reasons.

Using erct_slave_config_sync_manager by itself is fairly pointless.  You need to specify the PDOs contained in the SM and then also actually use at least one PDO from each SM in your domain mapping.  Typically you use ecrt_slave_config_pdos to do the former and ecrt_domain_reg_pdo_entry_list for the latter.  See the example code.

From: Mohsen Alizadeh Noghani
Sent: Wednesday, 26 September 2018 22:32
To: etherlab-users at etherlab.org
Subject: [etherlab-users] Error flag after requesting SAFEOP

Hello everyone.

When I request SAFEOP state for my slave (Mecapion L7N) using shell command

$ ethercat state --position 0 SAFEOP

the slave's flag changes from + to E, and the state stays at PREOP.

Additional Info:
In a previous project, I used SOEM library and had to deal with the same issue, which was fixed by manually enabling sync managers 2 & 3.

ec_slave[1].SM[2].SMflags |= 0x00010000;
ec_slave[2].SM[3].SMflags |= 0x00010000;

I tried to do the same by the adding following lines in my a simple code

ret1 = erct_slave_config_sync_manager(sc, 2, EC_DIR_INPUT, EC_WD_ENABLE)
ret2 =  erct_slave_config_sync_manager(sc, 3, EC_DIR_OUTPUT, EC_WD_ENABLE)

Both function calls are successful (ret1=ret2=0) but the slave won't reach SAFEOP.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20180926/781e8e41/attachment-0003.htm>


More information about the Etherlab-users mailing list