//开启数据传输 设置传输速率 public bool setMFLIenableAndrate(ziDotNET daq, String dev) { //开始采集前必须确保数据传输开启 daq.syncSetInt(DemodsEnablepath, 1); //数据传输速率 daq.syncSetInt(DemodsEnablepath, 857100); // 最大857100 return(true); }
//设置输出 public bool SetSignalInputSetting(ziDotNET daq, String dev, double SignalInputManualRangeValue = 0.30000, long isSignalInputAutoRange = 0, double SignalInputScalingValue = 1.000, long isSignalInputACCoupling = 1, long isSignalInput50Ohm = 1, long isSignalInputFloatGround = 1) { //开始设置输入参数 try { if ((int)isSignalInputAutoRange != 0) //如果自动量程开启则不用设置手动量程 { daq.syncSetDouble(SignalInputManualRangePath, SignalInputManualRangeValue); //默认300mV ,若设置的量程低于实际输入值,系统会自动选择一个合适的量程 } daq.syncSetInt(SignalInputAutoRangePath, isSignalInputAutoRange); //默认关闭 daq.syncSetDouble(SignalInputScalingPath, SignalInputScalingValue); //缩放因子,默认不缩放 1.000 daq.syncSetInt(SignalInputACCouplingPath, isSignalInputACCoupling); //默认 使用AC耦合 daq.syncSetInt(SignalInputSwitchBetween50And10MegaOhmPath, isSignalInput50Ohm); //默认使用50欧姆 daq.syncSetInt(SignalInputFloatPath, isSignalInputFloatGround); //默认悬浮地 } catch (ZIException e) { System.Diagnostics.Trace.WriteLine(e.ToString(), "Warning"); } return(true);//设置成功标志 }
//设置输入 public bool SetSignalOutputSetting(ziDotNET daq, String dev, long isSignalOutputSwitchOn = 1, long isSignalOutputImpendence50 = 1, double SignalOutputManualRangeValue = 0.500000, long isSignalOutputAutoRange = 0, double SignalOutputOffsetValue = 0, long isSignalOutputAmplitudesEnable = 1, double SignalOutputAmplitudesValue = 0.212132034) { //开始设置输出参数 try { daq.syncSetInt(SignalOutputSwitchOnPath, isSignalOutputSwitchOn); //默认 开启 1 daq.syncSetInt(SignalOutputImpendence50Path, isSignalOutputImpendence50); //默认开启 1 if ((int)isSignalOutputAutoRange != 0) //如果自动量程开启则不用设置手动量程 { daq.syncSetDouble(SignalOutputManualRangePath, SignalOutputManualRangeValue); // 量程 默认500mV (0.500000) } daq.syncSetInt(SignalOutputAutoRangePath, isSignalOutputAutoRange); //默认关闭 0 daq.syncSetDouble(SignalOutputOffsetPath, SignalOutputOffsetValue); //默认 0 daq.syncSetInt(SignalOutputAmplitudesEnablePath, isSignalOutputAmplitudesEnable); //默认开启 daq.syncSetDouble(SignalOutputAmplitudesValuePath, SignalOutputAmplitudesValue); //默认150mV Vrms 0.212132034 } catch (ZIException e) { System.Diagnostics.Trace.WriteLine(e.ToString(), "Warning"); } return(true);//设置成功标志 }