Skip to content

Commit aeaf81b

Browse files
committed
Add support of AI pseudoDiff termination.
Device that requires this (a PXIe-4499) does handle start delays the same way as other DAQs. This current code just ignores that for now until a better solution gets worked out. DO NOT TRUST ABSOLUTE TIMING OF ANALOG INPUTS on such devices until this gets handled correctly!
1 parent 5193aa9 commit aeaf81b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

labscript_devices/NI_DAQmx/blacs_workers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ def start_task(self, chans, rate):
475475
term = DAQmx_Val_RSE
476476
elif self.AI_term == 'Diff':
477477
term = DAQmx_Val_Diff
478+
elif self.AI_term == 'PseudoDiff':
479+
term = DAQmx_Val_PseudoDiff
478480

479481
for chan in chans:
480482
self.task.CreateAIVoltageChan(

labscript_devices/NI_DAQmx/models/get_capabilities.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ def AI_start_delay(device_name):
259259
input_type = c.DAQmx_Val_RSE
260260
elif supp_types & c.DAQmx_Val_Bit_TermCfg_Diff:
261261
input_type = c.DAQmx_Val_Diff
262+
elif supp_types & c.DAQmx_Val_Bit_TermCfg_PseudoDIFF:
263+
input_type = c.DAQmx_Val_PseudoDiff
262264
task.CreateAIVoltageChan(
263265
chan, "", input_type, Vmin, Vmax, c.DAQmx_Val_Volts, None
264266
)
@@ -271,7 +273,15 @@ def AI_start_delay(device_name):
271273
delay_from_sample_clock = float64()
272274
sample_timebase_rate = float64()
273275

274-
task.GetStartTrigDelay(start_trig_delay)
276+
try:
277+
task.GetStartTrigDelay(start_trig_delay)
278+
except PyDAQmx.DAQmxFunctions.AttributeNotSupportedInTaskContextError:
279+
# device does not have a Start Trigger Delay property
280+
# is likely a dynamic signal acquisition device with filter
281+
# delays instead.
282+
print(f'\t{model} does not have the StartTrigDelay Property!')
283+
print('\tDo not trust absolute analog input times on this device!!')
284+
start_trig_delay.value = 0
275285
try:
276286
task.GetDelayFromSampClkDelay(delay_from_sample_clock)
277287
except PyDAQmx.DAQmxFunctions.AttributeNotSupportedInTaskContextError:

0 commit comments

Comments
 (0)