Running this code, I expect to write the signal to line 2, but instead I get a strange error message about mismatching number of channels (even though there is no mismatch):
nidaqmx.errors.DaqError: Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.
When writing, supply data for all channels in the task. Alternatively, modify the task to contain the same number of channels as the data written.
Number of Channels in Task: 1
Number of Channels in Data: 1
Task Name: mytask
I'm aware that it's possible to avoid this by simply using signalLine2 as the input instead of the 2-dimensional signals variable, but sometimes you can end up in this situation when creating a varying number of signals in a loop.
Similarly, an error is raised when mixing Python lists and numpy arrays in the input:
nidaqmx.errors.DaqError: Write failed, because this write method only accepts boolean samples when there is one digital line per channel in a task.
Requested sample type: <class 'numpy.ndarray'>
Task Name: mytask
Hi!
Running this code, I expect to write the signal to line 2, but instead I get a strange error message about mismatching number of channels (even though there is no mismatch):
I'm aware that it's possible to avoid this by simply using
signalLine2
as the input instead of the 2-dimensionalsignals
variable, but sometimes you can end up in this situation when creating a varying number of signals in a loop.Similarly, an error is raised when mixing Python lists and numpy arrays in the input: