Jump to content
OMRON Forums

Extracting ProgRunning, ProgActive and ProgProceeding in C


tweekzilla

Recommended Posts

Hi,

 

I'm trying to extract the coordinate system parameter ProgRunning from a C program. I almost get it to work with the following code, except that the enum returned is either 0 or 1 - It does not for example return 2 if I engage a limit switch

 

I've posted the enum definition here for clarity:

 

enum progstatus {PROG_RUNNING, PROG_STOP_ON_PAUSE_STEP, PROG_STOP_ON_LIMIT, PROG_STOP_ON_BKPT, PROG_STOP_CODE_ERR, PROG_STOP_STACK_ERR,

PROG_STOP_LVAR_STACK_ERR, PROG_STOP_CALL_ERR, PROG_STOP_AXIS_ASSIGN_ERR, PROG_STOP_KINEMATICS_ERR, PROG_NOT_IN_USE = 16};

 

And my code:

 

#include // Global Gp Shared memory pointer

#include "../../Include/pp_proj.h"

#include

 

static volatile GateArray3 *TickGate3IC; //ASIC structure pointer

 

int main(void)

{

enum progstatus pp;

int coor_status;

InitLibrary();

pp = CoordStatus(1);

printf("%d\n", (int)pp);

CloseLibrary();

 

return -1;

}

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Guest
This topic is now closed to further replies.

×
×
  • Create New...