フィルターのクリア

Track movement of multiple computer mice?

2 ビュー (過去 30 日間)
Patrick Parker
Patrick Parker 2016 年 1 月 18 日
コメント済み: Dwayne Bourgoyne 2024 年 1 月 2 日
I want to track the movement of multiple computer mice, none of which are my cursor. The mice connect using USB ports. Can this be done using VISA? Is there a better way to do this?
I've built drivers for each computer mouse through National Instruments and I've confirmed they work in LabView. I can create a VISA-generic object for each mouse, as well as turn recording status 'on' and the transfer status to 'read.'
Mouse1 = visa('ni', 'USB0::0x046D::0xC07E::878C367F5351::RAW');
fopen(Mouse1);
Mouse1.RecordName = 'filename.txt';
readasync(Mouse1)
record(Mouse1,'on')
Mouse1
VISA-Generic Object Using NI Adaptor : USB0::0x046D::0xC07E::878C367F5351::0::RAW
Communication Address
Resource Address: USB0::0x046D::0xC07E::878C367F5351::0::RAW
Communication State
Status: open
RecordStatus: on
Read/Write State
TransferStatus: read
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0
record(Mouse1,'off')
stopasync(Mouse1)
I believe the data should be binary, though when I try access it, I get a warning:
fread(Mouse1)
Warning: Unsuccessful read: VISA: Unable to start operation because setup is
invalid (due to attributes being set to an inconsistent state).
ans =
Empty matrix: 1-by-0
I'm unsure what I'm doing incorrectly in my setup. Any advice?
Thanks.
p.s.- I have the instrument control toolbox for Matlab. Also, I can perform this in LabView, though it will be easier to sink with other data if I can run everything within Matlab.
  1 件のコメント
Dwayne Bourgoyne
Dwayne Bourgoyne 2024 年 1 月 2 日
I am very interested in your progress. I am working on a computer assignment for my classroom and would like to be able to use indpendent multiple mice (mouses).

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeInstrument Connection and Communication についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by