Jump to content
OMRON Forums

Coordinate System Status Parser


Omron Forums Support

Recommended Posts

Edit: removed my original code because it was incorrect. Here is the code you can use to read Coord[x].ProgActive, ProgRunning, and ProgProceeding in C:

 

int ProgIsRunning(unsigned int n)
{
   if ((pshm->Coord[n].Ldata.Status & 0x2E) == 0x20) return 1;
   else return 0;
}

int ProgIsActive(unsigned int n)
{
   if ((pshm->Coord[n].Ldata.Status & 0x20) == 0x20) return 1;
   else return 0;
}

int ProgIsProceeding(unsigned int n)
{
   if (((pshm->Coord[n].Ldata.Status & 0x2E) == 0x20) && (pshm->Coord[n].FeedHold != 1)) return 1;
   else return 0;
}

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello,

 

Charles and I worked on this one and identified some issues. We got the proper code as used in the firmware and it should be like this. I gave the routines names such that they can be used in C conditional statements nicely.

 

double ProgIsRunning()
{
   if ((Coord[n].Ldata.Status & 0x2e) == 0x20) return 1;
   else return 0;
}

double ProgIsActive()
{
   if ((Coord[n].Ldata.Status & 0x20) == 0x20) return 1;
   else return 0;
}

double ProgIsProceeding()
{
   if (((Coord[n].Ldata.Status & 0x2e) == 0x20) && (Coord[n].FeedHold != 1)) return 1;
   else return 0;
}

 

ex usage:

 

//sleep for 1ms intervals until motion prog is done. 
while(ProgIsRunning()) MySleepSeconds(0.001);  

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...