How to Read Data from Serial Port in R

徘徊边缘 提交于 2019-12-03 00:41:31

i am working with the serial-package (here) available on CRAN. This was developed to do exactly that what you need. Reading and sending data form and to RS232 etc. connections. I do really recommend this, because "mode.exe" seems not to work for virtual COM-ports. See NPort-Server etc.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!