That looks fine as far as it goes, but you do need to run the cyclic loop after calling ecrt_master_activate. That kicks off the configuration process but it requires several cycles to complete and actually transition the slaves to OP.
And once your application exits, the master will automatically deactivate and return the slaves to PREOP. From: Mohsen Alizadeh Noghani <m.aliza...@gmail.com> Sent: Monday, 1 October 2018 22:09 To: Gavin Lambert <gavin.lamb...@tomra.com>; etherlab-users@etherlab.org Subject: Re: [etherlab-users] API for enabling/disabling sync managers of a slave I still haven't been able to enable sync managers (and thus change the state to SAFEOP) Currently, I'm executing this code<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmohse-n%2FL7N_EtherLab%2Fblob%2Fmaster%2Fsimple_test.c&data=02%7C01%7Cgavin.lambert%40tomra.com%7Cde4676633de44877b14b08d6277d949a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C636739817661893040&sdata=L9ZYnno%2FqdrZNpqI7Zp02Xglc8dUybnVKy%2BnXniYeik%3D&reserved=0>, which is basically the user example. Output of $ethercat xml of the slave is: <?xml version="1.0" ?> <EtherCATInfo> <!-- Slave 0 --> <Vendor> <Id>30101</Id> </Vendor> <Descriptions> <Devices> <Device> <Type ProductCode="#x00000000" RevisionNo="#x00000002">L7N</Type> <Name><![CDATA[L7N]]></Name> <Sm Enable="1" StartAddress="#x1000" ControlByte="#x26" DefaultSize="128" /> <Sm Enable="1" StartAddress="#x1400" ControlByte="#x22" DefaultSize="128" /> <Sm Enable="0" StartAddress="#x1800" ControlByte="#x24" DefaultSize="0" /> <Sm Enable="0" StartAddress="#x1c00" ControlByte="#x20" DefaultSize="0" /> <RxPdo Sm="2" Fixed="1" Mandatory="1"> <Index>#x1601</Index> <Name>2nd Receive PDO Mapping</Name> <Entry> <Index>#x6040</Index> <SubIndex>0</SubIndex> <BitLen>16</BitLen> <Name>Controlword</Name> <DataType>UINT16</DataType> </Entry> <Entry> <Index>#x607a</Index> <SubIndex>0</SubIndex> <BitLen>32</BitLen> <Name>Target Position</Name> <DataType>UINT32</DataType> </Entry> </RxPdo> <TxPdo Sm="3" Fixed="1" Mandatory="1"> <Index>#x1a01</Index> <Name>2nd Transmit PDO Mapping</Name> <Entry> <Index>#x6041</Index> <SubIndex>0</SubIndex> <BitLen>16</BitLen> <Name>Statusword</Name> <DataType>UINT16</DataType> </Entry> <Entry> <Index>#x6064</Index> <SubIndex>0</SubIndex> <BitLen>32</BitLen> <Name>Position Actual Value</Name> <DataType>UINT32</DataType> </Entry> </TxPdo> </Device> </Devices> </Descriptions> </EtherCATInfo> On Wed, Sep 26, 2018 at 3:02 AM Gavin Lambert <gavin.lamb...@tomra.com<mailto:gavin.lamb...@tomra.com>> wrote: You typically don’t need to explicitly disable a sync manager; you simply don’t refer to it or any PDOs it contains, and then it will not be included in the domain’s data. Alternatively, you can configure the sync manager but then list zero PDOs for it, to explicitly set the PDO Assign register for that SM to 0 (for slaves that support flexible assignment). Note that you should not enable the SM watchdog if you’re setting it to have zero PDOs. It sounds like you should probably read the documentation for the EtherCAT protocol and for the Etherlab master in particular. From: Mohsen Alizadeh Noghani <m.aliza...@gmail.com<mailto:m.aliza...@gmail.com>> Sent: Wednesday, 26 September 2018 04:52 To: Gavin Lambert <gavin.lamb...@tomra.com<mailto:gavin.lamb...@tomra.com>>; etherlab-users@etherlab.org<mailto:etherlab-users@etherlab.org> Subject: Re: [etherlab-users] API for enabling/disabling sync managers of a slave Thanks Gavin. 1- Would ecrt_slave_config_sync_manager(sc, 2, EC_DIR_OUTPUT, EC_WD_ENABLE ) enable Sync Manager 2 of slave sc? 2- How can I disable it then? I doesn't seems the function provides an option to enable/disable. Best, Mohsen On Tue, Sep 25, 2018 at 2:40 AM, Gavin Lambert <gavin.lamb...@tomra.com<mailto:gavin.lamb...@tomra.com>> wrote: You need to write an application, and then use ecrt_slave_config_sync_manager or ecrt_slave_config_pdos to configure the Sync Managers for each slave. From: Mohsen Alizadeh Noghani Sent: Tuesday, 25 September 2018 02:29 To: etherlab-users@etherlab.org<mailto:etherlab-users@etherlab.org> Subject: [etherlab-users] API for enabling/disabling sync managers of a slave Hello everyone. Is there a function call that I can use for enabling a particular sync manager of a slave? For example, I'd like to enable sync manager 2 of slave 1. Best, Mohsen
_______________________________________________ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users