Io Modbus模拟器奇怪的行为

Io Modbus模拟器奇怪的行为,io,serial-port,simulator,modbus,Io,Serial Port,Simulator,Modbus,我正在运行以下modbus从属模拟器以及以下modbus轮询器。奇怪的是,我不能让他们发现彼此。这是从模拟器的输出 Protocol configuration: Modbus RTU Slave configuration: address = -1, master activity t/o = 3.00 Serial port configuration: /dev/ttyS0, 19200, 8, 1, even Server started up successfully. Liste

我正在运行以下modbus从属模拟器以及以下modbus轮询器。奇怪的是,我不能让他们发现彼此。这是从模拟器的输出

Protocol configuration: Modbus RTU
Slave configuration: address = -1, master activity t/o = 3.00
Serial port configuration: /dev/ttyS0, 19200, 8, 1, even

Server started up successfully.
Listening to network (Ctrl-C to stop)
....................
以下是modbus轮询器的输出

Protocol configuration: Modbus RTU
Slave configuration...: address = 1, start reference = 1, count = 1
Communication.........: /dev/ttyS0, 19200, 8, 1, even, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave... (Ctrl-C to stop)
Reply time-out!
-- Polling slave... (Ctrl-C to stop)

如您所见,modbus从属模拟器和modbus轮询器都具有相同的值,应该能够找到彼此。不过,我觉得奇怪的是,他们不能。是否有人对可能导致这种情况的原因有任何建议?

超时可能有多种原因,例如

从设备中不存在您轮询的寄存器地址,请检查您轮询的寄存器类型是否正确

从机和主机之间尚未建立连接这可能是由于配置从机和主机串行端口接口不正确所致

还要检查串行链路是否已正确连接到从机和主机两端的正确引脚

-检查主机上设置的超时时间。您可能已将其设置为非常低的值,因此将错过从机的响应


希望这能有所帮助。

我想出来了。没有与设备接口的内置API。因此,向设备发送数据时,设备试图同时发送数据,但操作不正确。自己编写的驱动程序现在工作起来很有魅力。