forked from M-Labs/artiq
1
0
Fork 0
artiq/artiq
Yann Sionneau da1398b183 pxi6733: fix crash when samples are all the same
When samples are all the same, min = max, which PyDAQmx does not like.
This avoids the following crash reported by Kathie:

C:\Users\rabi\artiq\artiq\frontend [master]> python .\artiq_rpctool.py ::1 3256
call load_sample_values 100000 'np.array([0.0,0.0],dtype=float)'
Traceback (most recent call last):
  File ".\artiq_rpctool.py", line 112, in <module>
    main()
  File ".\artiq_rpctool.py", line 107, in main
    call_method(remote, args.method, args.args)
  File ".\artiq_rpctool.py", line 79, in call_method
    ret = method(*[eval(arg) for arg in args])
  File "C:\Users\rabi\AppData\Local\Continuum\Anaconda3\lib\site-packages\artiq-
0.0+dev-py3.4.egg\artiq\protocols\pc_rpc.py", line 142, in proxy
    return self.__do_rpc(name, args, kwargs)
  File "C:\Users\rabi\AppData\Local\Continuum\Anaconda3\lib\site-packages\artiq-
0.0+dev-py3.4.egg\artiq\protocols\pc_rpc.py", line 134, in __do_rpc
    return self.__do_action(obj)
  File "C:\Users\rabi\AppData\Local\Continuum\Anaconda3\lib\site-packages\artiq-
0.0+dev-py3.4.egg\artiq\protocols\pc_rpc.py", line 128, in __do_action
    raise RemoteError(obj["message"])
artiq.protocols.pc_rpc.RemoteError: Traceback (most recent call last):
  File "C:\Users\rabi\AppData\Local\Continuum\Anaconda3\lib\site-packages\artiq-
0.0+dev-py3.4.egg\artiq\protocols\pc_rpc.py", line 476, in _handle_connection_cr

    ret = method(*obj["args"], **obj["kwargs"])
  File "C:\Users\rabi\AppData\Local\Continuum\Anaconda3\lib\site-packages\artiq-
0.0+dev-py3.4.egg\artiq\devices\pxi6733\driver.py", line 117, in load_sample_val
ues
    byref(num_samps_written), None)
  File "<string>", line 3, in WriteAnalogF64
  File "<string>", line 2, in function
  File "C:\Users\rabi\AppData\Local\Continuum\Anaconda3\lib\site-packages\pydaqm
x-1.3.1-py3.4.egg\PyDAQmx\DAQmxFunctions.py", line 28, in mafunction
    raise DAQError(error,errBuff.value.decode("utf-8"), f.__name__)
PyDAQmx.DAQmxFunctions.DAQError: Minimum is greater than or equal to the maximum
. Ensure the maximum value is greater than the minimum value. If using a custom
scale, ensure that the scaled maximum is greater than the scaled minimum.
Property: DAQmx_AO_Min
Corresponding Value:  0.0

Property: DAQmx_AO_Max
Corresponding Value:  0.0

Channel Name: Dev1/ao1

Task Name: _unnamedTask<4>

Status Code: -200082
 in function DAQmxWriteAnalogF64
2015-08-19 12:49:33 +02:00
..
coredevice ttl: minor docstring cleanup 2015-08-17 23:50:24 +08:00
devices pxi6733: fix crash when samples are all the same 2015-08-19 12:49:33 +02:00
frontend influxdb: tag-based schema, better type support 2015-08-18 14:49:23 +08:00
gateware rtio: detect collision errors 2015-07-29 19:43:35 +08:00
gui gui/tools: better detection of scalar types 2015-08-17 23:14:18 +08:00
language doc: environment 2015-08-18 23:30:50 +08:00
master scheduler: refactor, fix pipeline hazards 2015-08-10 21:58:11 +08:00
protocols pc_rpc/Server: show builtin terminate in method list 2015-08-17 23:03:43 +08:00
py2llvm Fold llvmlite patches into m-labs/llvmlite repository. 2015-08-05 03:49:01 +03:00
sim refactor ddb/pdb/rdb 2015-07-13 22:21:32 +02:00
test test/pc_rpc: use builtin_terminate 2015-08-17 23:17:13 +08:00
transforms expose machine units to user 2015-07-01 22:22:53 +02:00
wavesynth wavesynth/Synthesizer: allow empty data 2015-07-23 12:34:54 -06:00
__init__.py import DDS phase modes at the top level 2015-07-29 23:32:33 +08:00
tools.py scheduler: refactor, fix pipeline hazards 2015-08-10 21:58:11 +08:00