Batch file 使用windows终端连接COM端口

Batch file 使用windows终端连接COM端口,batch-file,cmd,terminal,serial-port,Batch File,Cmd,Terminal,Serial Port,是否有任何方法可以使用windows终端(windows 8使用windows powershell)连接COM端口(如COM4)并与之通信 写入串行端口 PS> [System.IO.Ports.SerialPort]::getportnames() PS> $port= new-Object System.IO.Ports.SerialPort COM4,9600,None,8,one PS> $port.open() PS> $port.WriteLine(“Hel

是否有任何方法可以使用windows终端(windows 8使用windows powershell)连接COM端口(如COM4)并与之通信

写入串行端口

PS> [System.IO.Ports.SerialPort]::getportnames()
PS> $port= new-Object System.IO.Ports.SerialPort COM4,9600,None,8,one
PS> $port.open()
PS> $port.WriteLine(“Hello world”)
PS> $port.Close()
PS> $port= new-Object System.IO.Ports.SerialPort COM4,9600,None,8,one
PS> $port.Open()
PS> $port.ReadLine()
从串行端口读取数据

PS> [System.IO.Ports.SerialPort]::getportnames()
PS> $port= new-Object System.IO.Ports.SerialPort COM4,9600,None,8,one
PS> $port.open()
PS> $port.WriteLine(“Hello world”)
PS> $port.Close()
PS> $port= new-Object System.IO.Ports.SerialPort COM4,9600,None,8,one
PS> $port.Open()
PS> $port.ReadLine()
我找到了两种方法:

  • 使用wsl和minicom:详细信息如下。
  • 但这对我不起作用

  • 使用python库: 这可以工作,但不如第一个强大

  • 希望找到新方法。

    您应该看看我的powershell控制台一直在等待。我想,因为com端口中的数据没有行尾字符