Serial COM port communication works great on all my devices except one. None of them use handshaking and I can’t get the one that requires handshaking to work. Am I setting this up correctly? Right now I’m just using the following commands
$port=new-object system.io.ports.serialport COM5, 9600, None, 8, one $port.handshake="XOnXOff" $port.open()
But it gives the following error
Exception calling "Open" with "0" argument(s): "Access to the port 'COM5' is denied." At line:1 char:11 + $port.open <<<< () + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
I can use software or hardware handshaking on the device. Right now I am trying to use the software handshaking option, but it isn’t working. Can anyone tell me what I’m doing wrong? Thank you for your time!