Ejemplo n.º 1
0
        private bool HighSpeedDataEthernetCommunicationInitalize()
        {
            _sendCommand = SendCommand.HighSpeedDataEthernetCommunicationInitalize;
            _deviceData[Define._currentDeviceId].ProfileData.Clear();  //Clear the retained profile data.
            _deviceData[Define._currentDeviceId].MeasureData.Clear();
            LJV7IF_ETHERNET_CONFIG ethernetConfig = _ethernetConfig;
            int rc = NativeMethods.LJV7IF_HighSpeedDataEthernetCommunicationInitalize(Define._currentDeviceId, ref ethernetConfig,
                                                                                      UInt16.Parse(iniH.Read("SensorControllerEthernet", "HighSpeedPort")), _callback,
                                                                                      1, (uint)Define._currentDeviceId);

            //AddLogResult(rc, Resources.SID_HIGH_SPEED_DATA_ETHERNET_COMMUNICATION_INITALIZE);

            if (rc == (int)Rc.Ok)
            {
                _deviceData[Define._currentDeviceId].Status         = DeviceStatus.EthernetFast;
                _deviceData[Define._currentDeviceId].EthernetConfig = ethernetConfig;
                AddLog("高速连接初始化 OK!");
                return(true);
            }
            else
            {
                AddLog("高速连接初始化 Fail!");
                return(false);
            }
        }
Ejemplo n.º 2
0
        private bool HighSpeedDataCommunicationFinalize()
        {
            int rc = NativeMethods.LJV7IF_HighSpeedDataCommunicationFinalize(Define._currentDeviceId);
            //AddLogResult(rc, Resources.SID_HIGH_SPEED_DATA_COMMUNICATION_FINALIZE);

            LJV7IF_ETHERNET_CONFIG config = _deviceData[Define._currentDeviceId].EthernetConfig;

            _deviceData[Define._currentDeviceId].Status         = DeviceStatus.Ethernet;
            _deviceData[Define._currentDeviceId].EthernetConfig = config;

            timer1.Stop();
            if (rc == (int)Rc.Ok)
            {
                AddLog("高速连接断开 OK!");
                return(true);
            }
            else
            {
                AddLog("高速连接断开 Fail!");
                return(false);
            }
            //_deviceStatusLabels[_currentDeviceId].Text = _deviceData[_currentDeviceId].GetStatusString();
        }
Ejemplo n.º 3
0
 internal static extern int LJV7IF_HighSpeedDataEthernetCommunicationInitalize(
     int lDeviceId, ref LJV7IF_ETHERNET_CONFIG pEthernetConfig, ushort wHighSpeedPortNo,
     HighSpeedDataCallBack pCallBack, uint dwProfileCnt, uint dwThreadId);
Ejemplo n.º 4
0
 internal static extern int LJV7IF_EthernetOpen(int lDeviceId, ref LJV7IF_ETHERNET_CONFIG ethernetConfig);