Borrar filtros
Borrar filtros

Track movement of multiple computer mice?

2 visualizaciones (últimos 30 días)
Patrick Parker
Patrick Parker el 18 de En. de 2016
Comentada: Dwayne Bourgoyne el 2 de En. de 2024
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 comentario
Dwayne Bourgoyne
Dwayne Bourgoyne el 2 de En. de 2024
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).

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Instrument Connection and Communication en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by