简体   繁体   English

如何同步从串行端口连接的远程部件接收的数据

[英]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.

相关问题 多虚拟串行端口不会刷新接收到的数据 - multi virtual serial ports does not refresh the received data 显示从串口接收的数据 - Displaying received data from serial port 解析从串口接收到的数据包 - Parsing the data packet received from serial port 如何正确地将接收到的串口数据解析成行? - How to correctly parse received serial data into lines? 如何处理串口接收到的数据不完整? - How to handle serial port incomplete received data? 使用Main()中多个串行端口的读取数据 - Using read data from multiple serial ports within Main() 如何使用通用Windows应用程序将串行数据写入COM端口? - How to write serial data to COM ports with Universal Windows Application? 如何在不使用复制的情况下将本地 SQL 服务器数据库的数据同步到远程 SQL 服务器? - How to synchronize data from local SQL Server database to remote SQL Server without using replication? 如何在文本框中显示从串行端口接收的数据而文本不会在Visual Studio C#中消失? - How to display data received from serial port in a textbox without the text disappearing in Visual Studio C#? 如何知道外部设备连接在哪个串行端口上并从该设备读取数据? - How to know on which serial port external device is connected and read data from that device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM