[etherlab-users] EL2502 problem

Michael Sagner msagner at msagner.de
Wed Nov 10 19:27:04 CET 2010


Hi Andreas,

I gleaned some of the initialization code from the -cstruct command.
What am I doing wrong?
Here's what I'm doing in the init routine: (see comment lines for
results/error messages)

----------------------------------------------------------------------------
----------
	ec_pdo_entry_info_t el2502_pdo_entries[] = {
	{0x7000, 0x11, 16}, /* PWM output */
	{0x7000, 0x12, 16}, /* Freq outtput */
	{0x7010, 0x11, 16}, /* PWM output */
	{0x7010, 0x12, 16}, /* PWM output */
	};
	
	ec_pdo_info_t el2502_pdos[] = {
	{0x1600, 1, el2502_pdo_entries + 0}, /* PWM RxPDO-Map  Ch.1 */
	{0x1602, 1, el2502_pdo_entries + 1}, /* Freq RxPDO-Map  Ch.1 */
	{0x1601, 1, el2502_pdo_entries + 2}, /* PWM RxPDO-Map  Ch.2 */
	{0x1603, 1, el2502_pdo_entries + 3}, /* Freq RxPDO-Map  Ch.2 */
	};
	
	ec_sync_info_t el2502_syncs[] = {
	{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
	{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
	{2, EC_DIR_OUTPUT, 4, el2502_pdos + 0, EC_WD_DISABLE},
	{3, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
	};

	if(ecrt_slave_config_pdos(m_pSlaveConfig, 1, el2502_syncs))
	{
			g_sErrorMessage = "New ecrt_slave_config_pdos()
failed for EL2502";
			return false;
// no problem here, no error message
	}

	int i_IO_PWOffset_0 =
ecrt_slave_config_reg_pdo_entry(m_pSlaveConfig, 0x7000, 0x11,
getMasterModule()->getDomain(), NULL);
	printf("EL 2502 Ch 0: PWOffset= 0x%X\r\n", i_IO_PWOffset_0);
// result is an offset of 2, no error message

	int i_IO_FreqOffset_0 =
ecrt_slave_config_reg_pdo_entry(m_pSlaveConfig, 0x7000, 0x12,
getMasterModule()->getDomain(), NULL);
	printf("EL 2502 Ch 0: FreqOffset= 0x%X\r\n", i_IO_FreqOffset_0);
// result is an offset of 0xFFFFFFFE, error message is: "Failed to register
PDO entry: No such file or directory"


-----Ursprüngliche Nachricht-----
Von: Andreas Stewering-Bone [mailto:ab at igh-essen.com] 
Gesendet: Mittwoch, 10. November 2010 11:30
An: Michael Sagner
Cc: etherlab-users at etherlab.org
Betreff: Re: [etherlab-users] EL2502 problem

Hello Michael,

Hardware version seems to be OK for the requested features.

you have to
- configure PDO 1602 and 1603
- configure PDO-Entries 7000:17 7000:18 7010:17 7010:18
- map PDO-Entries 7000:17 7000:18 7010:17 7010:18

and then it should work I think.

Do you get a failure message?


Greatings

Andreas

Michael Sagner schrieb:
> Hello Andreas,
> thx for your answer. Here's the requested info:
>
> the outpout of the 'slaves' command is:
>
> === Master 0, Slave 3 ===
> State: PREOP
> Flag: +
> Identity:
>   Vendor Id:       0x00000002
>   Product code:    0x09c63052
>   Revision number: 0x00120000
>   Serial number:   0x00000000
> DL information:
>   FMMU bit operation: no
>   Distributed clocks: yes, 64 bit
>   DC system time transmission delay: 430 ns
> Port  Type  Link  Loop    Signal  NextSlave  RxTime [ns]  Diff [ns]
NextDc
> [ns]
>    0  EBUS  up    open    yes             2    496471658           0
> 140
>    1  EBUS  up    open    yes             4    496473098        1440
> 140
>    2  N/A   down  closed  no              -            -           -
> -
>    3  N/C   down  closed  no              -            -           -
> -
> Mailboxes:
>   Bootstrap RX: 0x1000/244, TX: 0x10f4/244
>   Standard  RX: 0x1000/128, TX: 0x1080/128
>   Supported protocols: CoE, FoE
> General:
>   Group: DigOut
>   Image name: 
>   Order number: EL2502
>   Device name: EL2502 2K. PWM Ausgang, 24V
>   CoE details:
>     Enable SDO: yes
>     Enable SDO Info: yes
>     Enable PDO Assign: yes
>     Enable PDO Configuration: no
>     Enable Upload at startup: no
>     Enable SDO complete access: no
>   Flags:
>     Enable SafeOp: no
>     Enable notLRW: no
>   Current consumption: 150 mA
>
> ----------------------------------------------------------------------
> ------
> -----------------------------------
> The output of the 'pdos' command is:
>
> === Master 0, Slave 3 ===
> SM0: PhysAddr 0x1000, DefaultSize  128, ControlRegister 0x26, Enable 1
> SM1: PhysAddr 0x1080, DefaultSize  128, ControlRegister 0x22, Enable 1
> SM2: PhysAddr 0x1100, DefaultSize    4, ControlRegister 0x24, Enable 1
>   RxPDO 0x1600 "PWM RxPDO-Map  Ch.1"
>     PDO entry 0x7000:11, 16 bit, "PWM output"
>   RxPDO 0x1601 "PWM RxPDO-Map  Ch.2"
>     PDO entry 0x7010:11, 16 bit, "PWM output"
> SM3: PhysAddr 0x1180, DefaultSize    0, ControlRegister 0x20, Enable 0
>
> -----Ursprüngliche Nachricht-----
> Von: Andreas Stewering-Bone [mailto:ab at igh-essen.com]
> Gesendet: Mittwoch, 10. November 2010 09:54
> An: Michael Sagner; etherlab-users at etherlab.org
> Betreff: Re: [etherlab-users] EL2502 problem
>
> Hello Michael,
>
> the documentation makes a note about different Hardware Versions.
>
> Changing the period via pdo mapping is only supported for version 
> higher or equal than 01.
>
> Please show following outputs
> -ethercat slaves -px -v
> -ethercat pdos -px
>
>
>
> Greatings
>
> Andreas
>
> Michael Sagner schrieb:
>   
>> I can set the pulse width of EL2502 PWM outputs without a problem, 
>> but I’m at a loss when it comes to setting their frequency.
>>
>> According to the Beckhoff docs, index 0x1600/0x1601 must be 
>> deactivated, and index 0x1602/0x1603 must be activated in order to do 
>> this.
>>
>> Q: How do I do this using ecrt_.... commands? Are there any code 
>> samples around somewhere?
>>
>> M. Sagner
>>
>> ---------------------------------------------------------------------
>> -
>> --
>>
>> _______________________________________________
>> etherlab-users mailing list
>> etherlab-users at etherlab.org
>> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>>   
>>     
>
>
>   


-- 

------------------------------------------------------------------------

Dipl.-Ing. Andreas Stewering-Bone            Amtsgericht Essen HRB 11500 
Ingenieurgemeinschaft IgH                    USt-Id.-Nr.: DE 174 626 722 
Gesellschaft für Ingenieurleistungen mbH     Geschäftsführung:           
Heinz-Bäcker-Str. 34                         Dr.-Ing. S. Rotthäuser      
D-45356 Essen                                Dr.-Ing. T. Finke           
Tel.: +49 201 / 360-14-15                    Dr.-Ing. W. Hagemeister     
Fax.: +49 201 / 360-14-14                    Tel.: +49 201 / 360-14-0    
Andreas.Stewering-Bone at igh-essen.com         http://www.igh-essen.com    

------------------------------------------------------------------------




More information about the Etherlab-users mailing list