当前位置: 首页>>代码示例>>Python>>正文


Python PyDAQmx.c_ulong方法代码示例

本文整理汇总了Python中PyDAQmx.c_ulong方法的典型用法代码示例。如果您正苦于以下问题:Python PyDAQmx.c_ulong方法的具体用法?Python PyDAQmx.c_ulong怎么用?Python PyDAQmx.c_ulong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyDAQmx的用法示例。


在下文中一共展示了PyDAQmx.c_ulong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: writeValues

# 需要导入模块: import PyDAQmx [as 别名]
# 或者: from PyDAQmx import c_ulong [as 别名]
 def writeValues(self, chanNames, data):
     DebugLog.log("DAQhardware.writeValue(): chanNames= %s val= %s" % (repr(chanNames), repr(data)))
     
     self.analog_output = None   # ensure the output task is closed
     samplesWritten = daqmx.int32()
     analog_output = daqmx.Task()
     data = np.vstack((data, data))
     data = data.transpose()
     data = np.require(data, np.double, ['C', 'W'])
     numSamples = 2
     outputRate = 1000
     
     for chanName in chanNames:
         analog_output.CreateAOVoltageChan(chanName,"",-10.0,10.0, daqmx.DAQmx_Val_Volts, None)
     analog_output.CfgSampClkTiming("",outputRate, daqmx.DAQmx_Val_Rising, daqmx.DAQmx_Val_FiniteSamps, numSamples)
     analog_output.WriteAnalogF64(numSampsPerChan=numSamples, autoStart=True,timeout=1.0, dataLayout=daqmx.DAQmx_Val_GroupByChannel, writeArray=data, reserved=None, sampsPerChanWritten=byref(samplesWritten))
     DebugLog.log("DAQhardware.setupAnalogOutput(): Wrote %d samples" % samplesWritten.value)
     
     # wait until write is completeled
     isDone = False
     isDoneP = daqmx.c_ulong()
     while not isDone:
         err = analog_output.IsTaskDone(byref(isDoneP))
         isDone = isDoneP.value != 0
             
     analog_output = None
开发者ID:skymini00,项目名称:PyVib,代码行数:28,代码来源:DAQHardware.py

示例2: waitDoneTask

# 需要导入模块: import PyDAQmx [as 别名]
# 或者: from PyDAQmx import c_ulong [as 别名]
 def waitDoneTask(task, timeout):
     err = 0
     isDone = False
     isDoneP = daqmx.c_ulong()
     tElapsed = 0
     lastTime = time.time()
     while not isDone:
         task.IsTaskDone(byref(isDoneP))
         # DebugLog.log("waitDoneTask(): isDoneP= %s" % repr(isDoneP))
         isDone = isDoneP.value != 0
         timeNow = time.time()
         tElapsed += timeNow - lastTime
         lastTime = timeNow
         if timeout >= 0 and tElapsed > timeout:
             if not isDone:
                 err = -1
             isDone = True
         
     return err
开发者ID:skymini00,项目名称:PyVib,代码行数:21,代码来源:DAQHardware.py


注:本文中的PyDAQmx.c_ulong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。