22#if !defined(__INTIME__)
30const int AXIS_COUNT = 2;
31const int DESIRED_POINTS = 50;
32const int SYNC_PERIOD = 10;
34int32_t lastSample = 0;
36#pragma region Fixed Size Implementation
42const int POINT_BLOCK_COUNT = 10;
43int32_t extraPointsSentToEvenOutBlock = 0;
46int32_t AdjustPointsNeededToBlockCount(int32_t initialCount)
48 int32_t calculatedCount = 0;
49 int32_t adjustedInitialCount = initialCount - extraPointsSentToEvenOutBlock;
51 while ((adjustedInitialCount > 0) && (adjustedInitialCount > calculatedCount))
53 calculatedCount += POINT_BLOCK_COUNT;
57 extraPointsSentToEvenOutBlock += calculatedCount - initialCount;
59 return calculatedCount;
63volatile int _continueMonitoring =
true;
67void monitoringThread(
void* tmp)
75 while (_continueMonitoring)
80 int32_t pointsNeeded = sampleRecieved - lastSample;
83 pointsNeeded = AdjustPointsNeededToBlockCount(pointsNeeded);
90 lastSample = sampleRecieved;
103 printf(
"Error Found: %s\n", object->
ErrorLogGet()->text);
108void streamingMotionBufferManagementMain()
113 checkErrors(controller);
121 checkErrors(controller);
124 _beginthread(monitoringThread, 0, controller);
127 bool exitCondition =
false;
128 while (!exitCondition)
135 printf(
"\n%s\n", err.text);
140 _continueMonitoring =
false;
void SyncInterruptEnableSet(bool enable)
Configure Sync (periodic) interrupts for the controller.
void SyncInterruptPeriodSet(uint32_t samples)
Configure the period for the Sync Interrupt on the controller.
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
int32_t SyncInterruptWait()
Suspend the current thread until an interrupt arrives from the controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
void NetworkStart()
Start the network with RSINetworkStartupMethodNORMAL.
const RsiError *const ErrorLogGet()
Get the next RsiError in the log.
int32_t ErrorLogCountGet()
Get the number of software errors in the error log.
The RapidCode base class. All non-error objects are derived from this class.
Represents the error details thrown as an exception by all RapidCode classes. This class contains an ...