Programmatically find COM and LPT address

9 次查看(过去 30 天)
I am using Matlab to program an experiment.
In particular, I am using these lines of code to read and send triggers to an external device:
ioObj = io64;
status = io64(ioObj);
io64(ioObj,portWriteAddress,0);
I have found the value for 'portWriteAddress by navigating to: Device manager -> Ports -> LPT1 -> Resources. Then, in Resources there is an entry called I/O Range/ Settings with a code like 02S7 - 02SS (something like that).
Then I have converted it from Hex to Dec and put it in the line above.
THE PROBLEM IS: I am running this experiment on several different computers. Is there a way to programmatically find this range (or address) information fromMatlab?
Thank you all for your time.
Gluce
P.S. The OS that I am using is Windows 7 (it should be soon updated to windows 10). The computers are running either Matlab 2015b or 2016b.
  1 个评论
Ming Yue
Ming Yue 2018-10-18
When I connect a Raspberry pi device to USB, I don't see the Resources tab in the Device manager. However some other ports do have the Resources tab. So I think the I/O Range is not a common property and it likely depends on the driver of the device.
If there is any Windows Command that could show this I/O Range property, then you can make system calls in MATLAB using " system " function and get system outputs.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Use COM Objects in MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by