Dear reader, I am working with a DC motor with encoder. Previously, I have been using an Arduino to control the speed of the motor. However, this hardware isn't reliable enough. Therefore, I am using a National Instruments USB6001 by now.
Right now, I am struggling with reading the encoder. It is possible to use an analog input for that. But, it seems that there is also a counter input available. Can you tell me how to use that? With the following code I get the error "The session contains channels that do not support clocked operations using startForeground and startBackground. Only on-demand operations using inputSingleScan and outputSingleScan can be done."
s_continuous = daq.createSession('ni'); ch_counter = addCounterInputChannel(s_continuous,'Dev1', 'ctr0', 'EdgeCount'); ch_counter.ActiveEdge = 'Falling'; s_continuous.DurationInSeconds = 10; startForeground(s_continuous)
Kind regards, Matthijs