#include "KMotionDef.h" #define TMP 10 // which spare persist to use to transfer data #include "KflopToKMotionCNCFunctions.c" #define IDLE 0 #define WAITING_RESPONSE 1 int MessageState=IDLE; main() { int Response; MsgBoxNoWait("ESTOP!! E-stop activated, or Axis drive in error",MB_OK|MB_ICONEXCLAMATION); MessageState=WAITING_RESPONSE; for (;;) { WaitNextTimeSlice(); if (MessageState==WAITING_RESPONSE) { printf("Here\n"); Delay_sec(1); if (MsgBoxGetResponse(&Response)==0) //Communication successful? { // yes, show response printf("Message Response was %d\n", Response); MessageState=IDLE; } } } }