How to Read Data from Serial Port in R

前端 未结 2 1834
攒了一身酷
攒了一身酷 2021-02-02 03:43

I\'m wanting to plot live data from the serial port. I figured R would be a good tool for the job. I\'m stumbling on trying to read data from the serial port (COM4). I\'ve ve

2条回答
  •  星月不相逢
    2021-02-02 04:19

    Teraterm and Windows use a different mechanism to configure serial devices. Are your system connection settings ok compared to what is configured in teraterm? Re-check the configuration parameter in teraterm and then use them to set your COM4: configuration in R.

    system("mode COM4: BAUD=115200 PARITY=N DATA=8 STOP=1")

    see mode /? on your command prompt for further parameters

    it might also be helpful to read data character by character using readChar()

    It sometimes happens that teraterm doesn't close RS232 connections properly.

提交回复
热议问题