OPT MACHINE VISION TECH.CO. LTD
ADD:8 JingSheng Road, JingXia ChangAn DongGuan China 523853
TEL: 0769-82716188 FAX: 0769-81606698
E-mail:
Website:Http://www.optmv.net
25
OPTControllerAPI OptController = new OPTControllerAPI();
do
{
//OptController.InitSerialPort("COM1");
//Create an Ethernetconnection by IP address e.g. “192.168.1.16”
if (0 !=OptController.CreateEtheConnectionByIP("192.168.1.16") )
{
Console.WriteLine("Connection failed");
break;
}
//Set the intensity 0 to all channels
if (0 != OptController.SetIntensity( 0, 0))
{
Console.WriteLine("Failed to set intensity 0 for all channels");
break;
}
//Set the intensity 255 to channel 1
if (0 != OptController.SetIntensity( 0, 255))
{
Console.WriteLine("Failed to set intensity 255 for all channels ");
break;
}
//Read the intensity of the 1st chanel
if (0 != OptController.ReadIntensity( 1, ref(IntensityValue)))
{
Console.WriteLine(IntensityValue);
Console.WriteLine("Failed to read intensity for the 1st channels ");
break;
}
//Turn off all chanels
if (0 != OptController.TurnOffChannel( 0))
{
Console.WriteLine("Failed to turn off all channels");
break;
}
//Turn on all channels
if (0 != OptController.TurnOnChannel( 0))
{
Console.WriteLine("Failed to turn on all channels");
break;
}
} while (false);