Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Session with analog inputs and encoder counter in Python

Highlighted

Hello

 

I would like to use USB-6361 DAQcard with Python. Till now i used Matlab, and there i could  have synchrony acquisition of analog inputs and counter input (Matlab code is bellow). Same thing I want to do in Python, but I can't create Session or something similar with analog inputs and counter.

I tried with Task() but in it can be only AI or CI, not both.

 

Matlab code:

 

%daq.getDevices;

daq = daq.createSession('ni')

 

aiI = addAnalogInputChannel(daq,'Dev1', 'ai6', 'Voltage');

aiI.TerminalConfig='Differential';

aiU = addAnalogInputChannel(daq,'Dev1', 'ai7', 'Voltage');

aiU.TerminalConfig='Differential';

cnt = addCounterInputChannel(daq, 'Dev1', 'ctr1', 'Position');

cnt.EncoderType='X4';

aiI.Range=[-5 5];

aiU.Range=[-5 5];

daq.DurationInSeconds=5;

daq.Rate=1000;

cnt.resetCounter;

 

daq.DurationInSeconds=5;

data=startForeground(daq);

0 Kudos
Message 1 of 1
(107 Views)