[英]How to synchronize data received from remote parts connected by serial ports
I have a WinCE master board wich is connected by serial ports to several remote slave boards. 我有一个WinCE主板,它通过串行端口连接到几个远程从板。 These slaves boards measures potentials.
这些从属板测量电位。 The communication protocol between master ans slaves is based upon MODBUS.
主站与从站之间的通信协议基于MODBUS。
The master request a measure to one different slave every 300ms. 主机每300ms向一个不同的从机请求一个措施。 The slave targetted is changed for each request.
针对每个请求更改目标从站。
My problem is that I have to timestamp the received measures. 我的问题是我必须对收到的措施加盖时间戳。 So, how can I synchronize all slave boards to have an identical time reference for all ?
因此,如何同步所有从属板,以使所有从板具有相同的时间基准? The synchronisation have to pass through the serial commuinication which is not real time determined !
同步必须通过未实时确定的串行通信!
A lot depends on the rest of your hardware, really. 实际上,很大程度上取决于您的硬件的其余部分。 Ideally you have a clock signal going from the master to each board which keeps all of the local clocks on the same time reference.
理想情况下,您需要一个从主机到每个板的时钟信号,以使所有本地时钟都在同一时间基准上。 As an initial synchronization mechanism, you can send down a MODBUS register write to preload a future time and then use one of the other serial port lines (DTR, CTS, etc.) as a trigger to load that time into the clock on the slave board.
作为初始同步机制,您可以发送MODBUS寄存器写操作以预加载将来的时间,然后使用其他串行端口线(DTR,CTS等)中的一个作为触发条件,将该时间加载到从属设备的时钟中板。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.