How to read multiple quadrature encoders using data acquisition tool box?

2 ビュー (過去 30 日間)
hassan talat
hassan talat 2019 年 7 月 9 日
Hello,
I want to read 3 encoders in matlab using NI USB 6343. I am using data acquisition tool box in matlab. These are the steps that i followed:
1. Daq session created
s = daq.createSession('ni');
2. Channels defined
ch = addCounterInputChannel(s, 'Dev1', [0 1 2], 'Position');
3. Read angles using
inputSingleScan(s) * 360/1000
ans =
0 0 13.3200
Now the probem is that I only receive updated value of the last encoder i.e encoder 2. First and second values are always '0'. Same is the case when I add two encoder channels. Only the last one gets updated. I have checked each encoder individually (they works fine). When I keep only encoder it always gives the required updated value on giving command inputSingleScan(s).
I have interfaced three encoders simultaneously in LabView they work fine.
Can someone identify the mistake or propose a possible approach ??
Regards

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Acquisition Toolbox Supported Hardware についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by