在.cfg文件里按照这样的格式device0.name = "MCP" device0.protocol = "RTU" device0.slave_id = "1" device0.address = "/dev/ttyUSB0" device0.IP_Port = " " device0.RTU_Baud_Rate = "9600" device0.RTU_Parity = "O" device0.RTU_Data_Bits = "8" device0.RTU_Stop_Bits = "1"写入内容怎么写??
时间: 2023-03-31 17:01:19 浏览: 164
你可以按照以下格式写入.cfg文件:
[device]
name = MCP
protocol = RTU
slave_id = 1
address = /dev/ttyUSB
IP_Port =
RTU_Baud_Rate = 960
RTU_Parity = O
RTU_Data_Bits = 8
RTU_Stop_Bits = 1
注意,每个属性的值都需要用等号和引号括起来,属性之间需要用换行符分隔。同时,属性名和属性值之间需要用空格分隔。
阅读全文