Error when setting an AnalogOut to a constant value

46 views
Skip to first unread message

Jean-Baptiste Gerent

unread,
Nov 5, 2024, 2:06:06 PM11/5/24
to the labscript suite
Good morning ,
I've recently installed the Labscript suite on my experiment and still trying to get a sequence running. 
I have a Pulse Blaster and a NI_PCI_6733
The manual control of both the PB and the NI card works fine, and the AO channels of the NI card are updated correctly (using blacs). 
However when trying to program in in a table, I get the following error in blacs : 

2024-11-05 12:25:19,971 ERROR BLACS.ni_pci_6733_main_worker.worker: Exception in job:

Traceback (most recent call last):

File "C:\Users\ultracold\.conda\envs\labscript\Lib\site-packages\blacs\tab_base_classes.py", line 898, in _transition_to_buffered

return self.transition_to_buffered(

^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\ultracold\.conda\envs\labscript\Lib\site-packages\labscript_devices\NI_DAQmx\blacs_workers.py", line 346, in transition_to_buffered

AO_final_values = self.program_buffered_AO(AO_table)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\ultracold\.conda\envs\labscript\Lib\site-packages\labscript_devices\NI_DAQmx\blacs_workers.py", line 313, in program_buffered_AO

self.AO_task.WriteAnalogF64(

File "<string>", line 3, in WriteAnalogF64

File "<string>", line 2, in function

File "C:\Users\ultracold\.conda\envs\labscript\Lib\site-packages\PyDAQmx\DAQmxFunctions.py", line 62, in mafunction

raise exception_class(errBuff.value.decode("utf-8"), f.__name__)

PyDAQmx.DAQmxFunctions.DeviceNameNotFound_RoutingError: No device by the given name was found.


Device Specified: ni_pci_6733


Channel Name: Dev1/ao0


Task Name: _unnamedTask<2>


Status Code: -88717

in function DAQmxWriteAnalogF64


Commenting raise exception_class(errBuff.value.decode("utf-8"), f.__name__) in  .conda\envs\labscript\Lib\site-packages\PyDAQmx\DAQmxFunctions.py at L62 gives the following blacs output, the output voltage doesn't change but the value displayed on the blacs interface does get updated according to the last value : 
2024-11-05 12:55:25,619 INFO BLACS.ni_pci_6733_main_worker.worker: Stopping AO at sample 0 of 0 

The shutters open and close at the correct timing without any issue. 
I don't really know how to further debug this, let me know if someone has any ide
a. 

Attached is my connection table script. and bellow is an inconclusive attempt to debug it further :



I've tried to find where the function was defined but I'm getting a bit lost. Here is what I've figured out so far :

R780_AOM.constant(t,1) trigger in blacs_worker.py the function program_buffered_AO which reach  self.AO_task.WriteAnalogF64()
This function is defined in 
.conda\envs\labscript\Lib\site-packages\PyDAQmx\Task.py 

Task.py convert functions defined in task_function_list as functions of the worker. 


task_function_list  is populated in .conda\envs\labscript\Lib\site-packages\PyDAQmx\DAQmxFunctions.py around L206. 
It is populated via .
conda\envs\labscript\Lib\site-packages\PyDAQmx\DAQmxConfig.py which reach for NIIMAQdx.h (for me, on Windows, it's in C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\include)



Best regards, 
JB Gerent. 

connection_table.py

Jean-Baptiste Gerent

unread,
Nov 6, 2024, 11:09:48 AM11/6/24
to the labscript suite
SOLVED : 
The issue was in my declaration of the NI card : 
I was using : 
NI_PCI_6733(name='ni_pci_6733', parent_device=pb_clockline_fast,
             clock_terminal='/ ni_pci_6733  /PFI0', MAX_name='Dev1')
but it should be : 
NI_PCI_6733(name='ni_pci_6733', parent_device=pb_clockline_fast,
             clock_terminal='/Dev1/PFI0', MAX_name='Dev1')

For the admin : either delete this if it is irrelevant or keep it for log, 
Associated DAQmx error code was : -88717 

Best, 
JB. 

dihm....@gmail.com

unread,
Nov 7, 2024, 10:27:52 AM11/7/24
to the labscript suite
JB,

Thanks for reporting back the fix. It is a subtle distinction that the clock terminal specifications have to use the MAX name. 

No doubt your efforts will save time for future users.
-David

Reply all
Reply to author
Forward
0 new messages