Jump to content
OMRON Forums

How can I get motor number in user pid ?


MS Lee

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

For anyone who uses this method, it seems that the base motor address and the size of each motor has changed in later firmware versions. Here is a corrected version that should work on any firmware:

 


unsigned int motor = (unsigned int)Mptr;
unsigned int mbase = (unsigned int)&pshm->Motor[0];
unsigned int msize = (unsigned int)&pshm->Motor[1] - mbase;

unsigned int mnum = (motor - mbase) / msize; // motor number

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...