Exemplo n.º 1
0
 //设置输出
 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);//设置成功标志
 }
Exemplo n.º 2
0
 //内部晶振频率设置
 public bool SetSignalOscillators(ziDotNET daq, String dev, double theOscillatorsFrequency = 100000.000)
 {
     //开始设置参数
     try
     {
         daq.syncSetDouble(SignalOscillatorsPath, theOscillatorsFrequency); ////默认 100kHz
     }
     catch (ZIException e)
     {
         System.Diagnostics.Trace.WriteLine(e.ToString(), "Warning");
     }
     return(true);//设置成功标志
 }
Exemplo n.º 3
0
 //设置输入
 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);//设置成功标志
 }