Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I know when an "ethercat rescan" system command has finished?
#1
When configuring PDOs on my EtherCAT network, I'm often required to issue the system command "ethercat rescan". This rescans the EtherCAT network such that the new PDOs become mappable.

However, there is not a good mechanism that I'm aware of for determining when the rescan command has finished. Because of this, we are forced to put timers into our code that wait for some arbitrary amount of time before we try mapping the PDOs.

Using timers like this is obvious bad practice and slows down our start-up process, however, I don't know of another way to monitor when the rescan command has completed.

Is there a preferred method for determining when the rescan has finished?
Reply
#2
Is this on Acontis or Etherlabs?
Reply
#3
(05-31-2019, 02:01 PM)Eric Hotchkiss Wrote: Is this on Acontis or Etherlabs?

Etherlab stack
Reply
#4
Is there a reason you need to programmatically perform an ecat reset (or ethercat rescan) before mapping PDOs? Normally we would save the project with this already done. Perhaps you mean enable ethercat with ECAT[0].Enable=1 and you just want to make sure the network is present first?
Reply
#5
(06-10-2019, 10:12 AM)Eric Hotchkiss Wrote: Is there a reason you need to programmatically perform an ecat reset (or ethercat rescan) before mapping PDOs? Normally we would save the project with this already done. Perhaps you mean enable ethercat with ECAT[0].Enable=1 and you just want to make sure the network is present first?

I support legacy code in which all EtherCAT variables are mapped in the following manner:

ECAT[master].IO[io_index].Slave = position;
ECAT[master].IO[io_index].Index = index;
ECAT[master].IO[io_index].SubIndex = $1;
ECAT[master].IO[io_index].BitLength = 1;
ECAT[master].IO[io_index].Input = 1;

However, some EtherCAT slave devices require their PDOs to be changed whenever a power cycle occurs. One of our drives for example doesn't broadcast certain information unless we write certain SDOs.

What this means for us is that certain PDOs are not mappable until we write new SDOs. Once we configure the SDOs, it is necessary to perform an "ethercat rescan", otherwise, the PMAC won't let us map to the new PDOs.

Essentially I need to wait for the ethercat rescan command to finish prior to trying to map certain PDOs when starting our machine.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)