摘要
用LabWin/CVI中RS232串口控制功能和I/O函数进行RS232/485的通信协议转换,以实现远程分布式测试控制系统的RS485总线通信。先打开通信端口并初始化、发送控制指令、获取采集信号。本地主控机通过RS485总线向现场信号采集设备发送控制指令并接收采集的测试数据,从而实现对RS485总线通信的控制。并在程序中并引入Win定时器检查端口状态,以提高通信控制的可靠性。
The communication protocol of RS232 to RS485 is translated with serial port control functions and I/O functions of Lab Windows/CVI, in order to realize communication control of RS485 bus in the remote distributed measurement and control system. At first, open COM ports and initialize them, send steering order and acquire sample signals. The local controller sends steering order to field signal-acquisition equipments and receives test data from RS485 bus, thereby communication control of RS485 bus was realized. The reliability of communication control can be improved greatly as a result of Win timer that can checks the states of COM ports was used in program.
出处
《兵工自动化》
2004年第3期40-41,共2页
Ordnance Industry Automation