Hi all,

even if I'm dealing with ethercat since more than one year, I'm in front of a very basic question ... As from I can see, the data in master->slave direction in the domain_pd area are not preserved from an update to another. I'mean that I need to write out data to domain_pd area at each cycle, even if I data is not changed and theoretically I don't need to update some parts of the pdo area.

Just applying this to the basic example in examples/user

void cyclic_task()
{
    int i;

    // receive process data
    ecrt_master_receive(master);
    ecrt_domain_process(domain1);

    // check process data state (optional)
    check_domain1_state();

    if (counter) {
        counter--;
    } else { // do this at 1 Hz
        counter = FREQUENCY;

        // calculate new process data
        blink = !blink;
    }

    EC_WRITE_U8(domain1_pd + off_dig_out, blink ? 0x06 : 0x09);

    // send process data
    ecrt_domain_queue(domain1);
    ecrt_master_send(master);
}


moving the EC_WRITE_U8 inside the if condition (after the blink=!blink) will not work, because the blink bit is cleared from the pdo area after the process data has been sent.

This means that I should keep a copy of the process data and write it on the domain1_pd each time.
Is this right or I'm missing something ?


Thanks,
Thomas.


_______________________________________________
etherlab-users mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to