Trying to read serial port input from a torque screwdriver

3 views (last 30 days)
I am trying to read the output torque from a torque screwdriver ( https://imada.com/products/cedar-did-4a-digital-torque-screwdriver/ ) and it is giving me this error for this code:
s=serialport("COM7",9600)
%open serial port
fopen(s);
%plotting data
i=1;
while(1)
data(i) = str2double(fscanf(s));
plot(data);
pause(0.01)
i = i + 1;
end
>> torquetest1
Error using serialport
Unable to connect to the serialport device at port 'COM7'. Verify that a device is connected to the port,
the port is not in use, and all serialport input arguments and parameter values are supported by the
device.
See related documentation for troubleshooting steps.
Error in torquetest1 (line 1)
s=serialport("COM7",9600)
I think it may just be an error with the device or that it is not meant for serial output because my device manager looks like this:
I have even tried using PuTTY to verify the COM7 port but it says access is denied and that it is unable to open the connection. Any help is appreciated.

Answers (1)

Gautam
Gautam on 28 Mar 2024 at 9:44
Hello Suraj,
I am not sure whether the device supports serial output, you would have to refer to the user manual or the product datasheet for that information. But if the device does support serial output, please ensure that the drivers for your USB-to-Serial adapter (if you're using one) or for the device itself are up to date.
Sometimes serial port permissions can cause the problem. Although, on Windows, permissions issues are less common, it’s still good to verify them.
If that doesn’t work, try using a different USB port or check if another application on your computer is already using COM7
If the device does not support serial communication in the way you're attempting, you may need to investigate any adapters or additional modules provided by the manufacturer for data logging.
Thank You,
Gautam Murthy

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!