using RSI.RapidCode.dotNET;
using RSI.RapidCode.dotNET.Enums;
using System;
{
class HomingWithAKDdrive
{
static void Main(string[] args)
{
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;
try
{
axis.
NetworkNode.
ServiceChannelWrite(modeOfOpIndex, modeOfOpSubindex, modeOfOpByteSize, modeOfOpValueToHOME);
System.Threading.Thread.Sleep(1000);
Console.WriteLine("HOME.MOVE");
UInt16 statusWordValue;
int isHomedvalue = 0;
while (isHomedvalue != 1)
{
isHomedvalue = statusWordValue >> 12;
}
Console.WriteLine("Axis homed.");
axis.NetworkNode.
ServiceChannelWrite(modeOfOpIndex, modeOfOpSubindex, modeOfOpByteSize, modeOfOpValueToDEFAULT);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Console.WriteLine("\nPress Any Key To Exit");
Console.ReadKey();
}
}
}