public void StartHighSpeedAcquistion(CancellationToken ct, Progress <int> progress, uint profileCount) { try { if (_connected) { _receivedProfileCount = 0; var ethernetConfig = new LJV7IF_ETHERNET_CONFIG(); StopHighSpeedAquisition(); Thread.Sleep(50); _timerHighSpeed.Start(); LJSetting.SetOpMode(_currentDeviceId, LJV7IF_OP_MODE.HIGH_SPEED); Thread.Sleep(50); InitHighSpeedUSBComms(20); StartHighSpeedDataCommunication(); _highSpeedCommsActive = true; } } catch (Exception) { throw; } }
public DataLib.CartData GetSingleProfile() { try { var data = new DataLib.CartData(); if (_connected) { _sendCommand = SendCommand.GetProfileAdvance; _deviceData.ProfileData.Clear(); _deviceData.MeasureData.Clear(); _measureDatas.Clear(); LJSetting.SetOpMode(_currentDeviceId, LJV7IF_OP_MODE.ADVANCED); Thread.Sleep(50); // Set the command function LJV7IF_PROFILE_INFO profileInfo = new LJV7IF_PROFILE_INFO(); uint dataSize = GetOneProfileDataSize(); int[] profileData = new int[dataSize / Marshal.SizeOf(typeof(int))]; LJV7IF_MEASURE_DATA[] measureData = new LJV7IF_MEASURE_DATA[NativeMethods.MeasurementDataCount]; using (PinnedObject pin = new PinnedObject(profileData)) { // Send the command rc = (Rc)NativeMethods.LJV7IF_GetProfileAdvance(_currentDeviceId, ref profileInfo, pin.Pointer, dataSize, measureData); CheckReturnValue(rc); // Response data display _measureDatas.Add(new MeasureData(0, measureData)); ExtractProfileData(1, ref profileInfo, profileData); } } return(_deviceData.ProfileData[0].GetCartData(_scalingMultiplier)); } catch (Exception) { throw; } }