68 lines
1.9 KiB
C#
68 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Sys;
|
|
namespace ConsoleTestDll
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
MACHINEINTERFACEDLL.SSI_STATUS_MOTION rStatus;
|
|
Console.WriteLine("Machine_Startup.");
|
|
rStatus = MACHINEINTERFACEDLL.Machine_Startup(false, MACHINEINTERFACEDLL.EHOME_MACHINE_MODE.HOME_XYZ);
|
|
Console.WriteLine("RStatus:{0}\n", rStatus);
|
|
Byte bDISts = 0;
|
|
Console.WriteLine("Machine_GetDIO.");
|
|
rStatus = MACHINEINTERFACEDLL.Machine_GetDIO(MACHINEINTERFACEDLL.EIO_PORT.LIMIT_SWITCH_J4, ref bDISts);
|
|
Console.WriteLine("RStatus:{0}\n", rStatus);
|
|
bool IOStatus = false;
|
|
int iComp1 = 1;
|
|
int iComp2 = 0;
|
|
int i = 0;
|
|
Console.WriteLine("IOStatus:");
|
|
for (i = 0; i < 6; i++)
|
|
{
|
|
iComp2=iComp1 << i;
|
|
if ((bDISts & iComp2) == iComp2)
|
|
{
|
|
IOStatus = true;
|
|
}
|
|
else
|
|
{
|
|
IOStatus = false;
|
|
}
|
|
Console.WriteLine("{0} ", IOStatus);
|
|
}
|
|
|
|
Console.WriteLine("Wait...");
|
|
Console.ReadLine();
|
|
Console.WriteLine("Machine_GetDIO.");
|
|
bDISts = 0;
|
|
rStatus = MACHINEINTERFACEDLL.Machine_GetDIO(MACHINEINTERFACEDLL.EIO_PORT.LIMIT_SWITCH_J4, ref bDISts);
|
|
Console.WriteLine("RStatus:{0}\n", rStatus);
|
|
i = 0;
|
|
Console.WriteLine("IOStatus:");
|
|
for (i = 0; i < 6; i++)
|
|
{
|
|
iComp2 = iComp1 << i;
|
|
if ((bDISts & iComp2) == iComp2)
|
|
{
|
|
IOStatus = true;
|
|
}
|
|
else
|
|
{
|
|
IOStatus = false;
|
|
}
|
|
Console.WriteLine("{0} ", IOStatus);
|
|
}
|
|
Console.WriteLine("Machine_Shutdown");
|
|
rStatus = MACHINEINTERFACEDLL.Machine_Shutdown();
|
|
Console.WriteLine("RStatus:{0}\n", rStatus);
|
|
Console.WriteLine("Press enter key to exit...");
|
|
Console.ReadLine();
|
|
}
|
|
}
|
|
}
|