#include "rsi.h"
#include "HelperFunctions.h"
#include <thread>
void HomingWithAKDdriveMain()
{
using namespace RSI::RapidCode;
const int AXIS_NUMBER = 0;
const int modeOfOpIndex = 0x6060;
const int modeOfOpSubindex = 0x0;
const int modeOfOpByteSize = 1;
const int modeOfOpValueToHOME = 6;
const int modeOfOpValueToDEFAULT = 8;
char rmpPath[] = "C:\\RSI\\X.X.X\\";
SampleAppsCPP::HelperFunctions::CheckErrors(controller);
try
{
SampleAppsCPP::HelperFunctions::StartTheNetwork(controller);
SampleAppsCPP::HelperFunctions::CheckErrors(axis);
axis->
NetworkNode->
ServiceChannelWrite(modeOfOpIndex, modeOfOpSubindex, modeOfOpByteSize, modeOfOpValueToHOME);
std::this_thread::sleep_for(std::chrono::seconds(1));
printf("\nHOME.MOVE");
uint16_t statusWordValue;
int isHomedvalue = 0;
while (isHomedvalue != 1)
{
isHomedvalue = statusWordValue >> 12;
}
printf("\nAxis homed.");
axis->NetworkNode->
ServiceChannelWrite(modeOfOpIndex, modeOfOpSubindex, modeOfOpByteSize, modeOfOpValueToDEFAULT);
}
{
printf(
"%s\n", err.
text);
}
system("pause");
}