OpenEtherCATsociety / SOES

Simple Open Source EtherCAT Slave
Other
588 stars 251 forks source link

do not update output variables in SafeOp #123

Closed konradhermsdorf closed 2 years ago

konradhermsdorf commented 2 years ago

Just read SM data to reset SM Watchdog but do not update the output variables linked to the RxPDOs in SafeOp

Closes #122

nakarlsson commented 2 years ago

Hi,

I see your point, I believe the intention was that leaving out cb_set_outputs from the if-clause above would serve the purpose. But, some variables might act as an outputs without beeing an physical output, so it make sense. Ex an FSoE frame.

I’m out of office this week and would like to test it first. So, I’ll verify the use case running FSoE CTT and complete the PR if it works.

regards Andreas

konradhermsdorf commented 2 years ago

Hi,

I see your point, I believe the intention was that leaving out cb_set_outputs from the if-clause above would serve the purpose. But, some variables might act as an outputs without beeing an physical output, so it make sense. Ex an FSoE frame.

I’m out of office this week and would like to test it first. So, I’ll verify the use case running FSoE CTT and complete the PR if it works.

regards Andreas

We saw the intent there as well. And for sure from an encapsulation point of view it makes sense to perform the actual switching of outputs inside the application code. The problems we faced on this approach are:

  1. another set of variables storing the "actual" output data inside the application-context means three copies of the "same" value: rxpdo[], variable referenced by objectlist and output-variable inside application context
  2. when reading the CoE-Object via CoE-mailbox communication, SOES takes the value inside the objectlist-referenced variable. So the value read via CoE might differ from the actual output-value that is set inside application context and yet the EtherCAT master would just read-back the value that was (falsely) set through RxPDO update in SafeOp.

As always there are many possible solutions and every application has different needs. This one is just my approach to deal with the problem we found through testing. So I wanted to share it with you :)

Conformance Test was succesful on my testbench but FSoE is not part of our scope so no FSoE test-cases are executed on my bench FYI

nakarlsson commented 2 years ago

it works fine, thanks