public void OpenEthernetCommunication() { CL3IF_ETHERNET_SETTING ethernetSetting = new CL3IF_ETHERNET_SETTING(); ethernetSetting.ipAddress = new byte[4]; ethernetSetting.ipAddress[0] = 192; ethernetSetting.ipAddress[1] = 168; ethernetSetting.ipAddress[2] = 0; ethernetSetting.ipAddress[3] = 1; ethernetSetting.portNo = 24685; ethernetSetting.reserved = new byte[2]; ethernetSetting.reserved[0] = 0x00; ethernetSetting.reserved[1] = 0x00; int returnCode = KeyenceHigh.CL3IF_OpenEthernetCommunication(CurrentDeviceId, ref ethernetSetting, 10000); SetDeviceStatement(returnCode, DeviceStatus.Ethernet); _deviceData[CurrentDeviceId].EthernetSetting = ethernetSetting; }
public DeviceData() { EthernetSetting = new CL3IF_ETHERNET_SETTING(); }
internal static extern int CL3IF_OpenEthernetCommunication(int deviceId, ref CL3IF_ETHERNET_SETTING ethernetSetting, uint timeout); //通讯连接