Jump to content
OMRON Forums

correct prototype for user algo?


steveneads

Recommended Posts

Hi

 

I have a confusion over the correct prototype declaration for a user algo. My function "preProcessFeedback" is running as a "User Servo" for motor 0. It doesn't need to write to a DAC and in fact it's not doing an real motor calculations. I'm running it in the phase cycle with Motor[0].PhaseCtrl = 8, so that it can ruin before the ECT is processed.

 

Originally my prototype for this function was:

 

void preProcessFeedback(struct MotorData *Mptr);

EXPORT_SYMBOL(preProcessFeedback);

 

A colleague suggested that it should really be:

 

double preProcessFeedback(struct MotorData *Mptr);

EXPORT_SYMBOL(preProcessFeedback);

 

With the latter declaration I added a "return 0" in the function.

It seems that in either form the code works - but which is the correct thing to do - or does it matter at all?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Guest
This topic is now closed to further replies.

×
×
  • Create New...