[etherlab-users] Beckhoff EL2502 Issue

Derrill Vezina dvezina at caron-eng.com
Mon May 13 15:31:19 CEST 2013


Hi,

I am currently writing software to use the Beckhoff EL2502 module. Using the cstruct output of the etherlab tool, I get the following pdo configuration:

/* Master 0, Slave 7, "EL2502"
* Vendor ID:       0x00000002
* Product code:    0x09c63052
* Revision number: 0x00170000
*/

ec_pdo_entry_info_t slave_7_pdo_entries[] = {
    {0x7000, 0x11, 16}, /* PWM output */
    {0x7010, 0x11, 16}, /* PWM output */
};

ec_pdo_info_t slave_7_pdos[] = {
    {0x1600, 1, slave_7_pdo_entries + 0}, /* PWM RxPDO-Map Ch.1 */
    {0x1601, 1, slave_7_pdo_entries + 1}, /* PWM RxPDO-Map Ch.2 */
};

ec_sync_info_t slave_7_syncs[] = {
    {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
    {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
    {2, EC_DIR_OUTPUT, 2, slave_7_pdos + 0, EC_WD_DISABLE},
    {3, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
    {0xff}
};

After reading through some of the beckhoff documentation, I changed my structures to accommodate the channel period registers...(I believe it is firmware specific).

// EL2502 PDO entries
ec_pdo_entry_info_t EL2502_pdo_entries[] = {
    {0x7000, 0x11, 16}, /* PWM CH1 output */
    {0x7000, 0x12, 16},             /* PWM CH1 period */
    {0x7010, 0x11, 16}, /* PWM CH2 output */
    {0x7010, 0x12, 16},             /* PWM CH2 period */
};

// EL2502 PDOs
ec_pdo_info_t EL2502_pdos[] = {
    {0x1602, 1, EL2502_pdo_entries + 0}, /* PWM RxPDO-Map Ch.1 */
    {0x1603, 1, EL2502_pdo_entries + 2}, /* PWM RxPDO-Map Ch.2 */
};

// EL2502 sync
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, 2, EL2502_pdos + 0, EC_WD_DISABLE},
    {3, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
    {0xff}
};

Has anyone ever set the frequency and pulse width of the ouput signal on either channel using pdo's? My project requires changing the pulse frequency and the pulse width on the fly and I was wondering if I can accomplish this using the pdo's. Does anyone else have different c structures they are using?

Thank you!

-Derrill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20130513/6e4948d1/attachment-0003.htm>


More information about the Etherlab-users mailing list