10003548-02
10003548-02
厦门岳航计算机工程有限公司
contact: 胡玲
Tel: +86-5 9 2-5 8 5 6 2 0 9 +86-1 8 0 3 0 2 3 5 3 1 1
Fax: +86-5 9 2-5 1 6 5 5 6 1(传真时请注明胡玲收,谢谢!)
QQ: 1 6 0 0 9 2 6 1 8 5
mail: 1 6 0 0 9 2 6 1 8 5 @qq.com
联系地址:厦门市思明区湖滨东路湖光大厦18楼B单元
西门子S7-200 PLC Modbus通讯应用
S7-200的串口Modbus通信被广泛应用于S7-200与仪表、变频器、HMI及第三方PLC的数据交换。S7-200 Modbus串口通信指令本身使用简单,但由于应用范围广泛,所以在应用中会遇到各种问题。 3 MKS baratron 127AA-000.1B-SP?HP, 0.1 TORR, used AMAT 0010-02450 Drive Assembly Single Wafer Loadlock 2 Stec LF-310A liquid flow MFC, LF-310A-EVD, TEPO, 0.25... TWO STEC LF-310A-EVD TEPO 0.25g and TiCl4 0.5 g/min STEC LF-310A-EVD TiCl4, 0.2g/min liquid flow controller TWO STEC LF-310A-EVD Ta(OC2H5)5, 0.2 g/min Novellus A95-122-01 Load Lock external door assembly Brooks 93033-799-21 Hardstop Kit, OEM spares, No TBM, N... Brooks MFC 5866E, N2 30 SLPM, New in Box AMAT 0190-00158 Gasonic LAMP,DRIVER,SPE?O CONTRO national instruments GPIB-120A, Bus Expander/isolat?or, ... Watlow 88-30620-300 Assembly Anafaze Controller, Liquid... IPEC speedfam 2805-740555 F, Pad conditioner assembly New AMAT 0150-02632 Cable Assy, N(M), R/A to N(M), STR ... 9 new AMAT 0020-43598 bracket clamp DC MKS Throttle Valve 683B-23795 Type 683 Control valve MKS Throttle Valve 683B-23795 Type 683 Control valve, S... AMAT 0242-76727 Kit, Special Handler, Cassette Platform... Lambda 48-12, Power Supply, LFS4812 Acces D/A16-16 Channel 16-Bit Analog Output Cards, PCI ... AMAT 7300-027077 Chuck, 300mm, An AI, AMAT 0010-37681, 5000/5200 Throttle Valve Assy Dual Spr... NEW Asyst Teach Pendant Controller 8045R2-1-SB-ASY?ST 04... Ex-Flow Mass/Meter Flow Controller Bronkhorst M2204198... Pixel Vision BV13CAAFLMV01FG?FBNTX AMRAY 800-1268 UVACOS Universal vacuum control system b... AMAT 0190-75084 VGA video interconnect PCB, ESW X3347 AMAT 0100-20001 System Electronics interface PCB board AMAT 0040-09675 Etch Chamber Cathode, Base with RF Rod Asyst 4296-02-1600006?5, PCB, Power Control, 3200-4296-0... NEW MKS HPS 155-1100P-24VDC ISOLATION VALVE NEW Millipore FC-260KZ, AMAT 0190-00029 MFC with AFC, 2... Swagelok SS-BN3847-C, AMAT 3870-01424, 3 Port Nupro bel... NEW LAM 716-028739-001 Gas ring protection sleeve AMAT 0020-30082 throttle valve 8 inch nitride body, reb... Advanced Energy Aera TC FC-PA7820C MFC, 100 SLM, Ar gas... Tylan general AC-2 throttle valve controller AC213C AMAT 0010-09416 P5000 Etch Chamber RF Match, Untested AMAT 0190-04025 Hose Assembly CH LID OUT TO CH BODY IN... Power-One SPM5D2D2V6 Switching DC Power Supply ASYST 3000-1121-01 REV D controller interface PCB, ASSY... ASYST 3200-1044-01 REV 6 controller interface PCB ASYST... NEW Mykrolis 2900 MFC FC-2902MEP5-T-4?V, N2, 5 SLPM Gas ... MKS 629B13TBCJ1B Baratron, 1000T 1/2VCR 15P 100C Thermo Electron Neslab Merlin M25 262112032000 Turns On.
Modbus是公开通信协议,其最简单的串行通信部分仅规定了在串行线路的基本数据传输格式,在OSI七层协议模型中只到1,2层。Modbus具有两种串行传输模式,ascii 和RTU。它们定义了数据如何打包、解码的不同方式。支持Modbus协议的设备一般都支持RTU格式。通信双方必须同时支持上述模式中的一种。Modbus是一种单主站的主/从通信模式。Modbus网络上只能有一个主站存在,主站在Modbus网络上没有地址,从站的地址范围为0-247,其中0为广播地址,从站的实际地址范围为1-247。Modbus通信标准协议可以通过各种传输方式传播,如RS232C、RS485、光纤、无线电等。在S7-200 CPU通信口上实现的是RS485半双工通信,使用的是S7-200的自由口功能。
S7-200通过以下方式支持Modbus通信协议:S7-200 CPU上的通信口0(Port0)通过指令库支持Modbus RTU从站模式。S7-200 CPU上的通讯口0和1(Port0和Port1)通过指令库支持Modbus RTU主站模式。
一、s7200 PLC MOdbus rtu通讯基础:1.Modbus RTU主站指令库的功能是通过在用户程序中调用预先编好的程序功能块实现的,该库对Port0和Port1有效。该指令库将设置通信口工作在自由口模式下。
2.Modbus RTU主站指令库使用了一些用户中断功能,编其他程序时不能在用户程序中禁止中断。
3.Modbus RTU主站库对CPU的版本有要求。CPU的版本必须为2.00或者2.01(即订货号为6ES721*-***23-0BA*),1.22版本之前(包括1.22版本)的S7-200 CPU不支持。
使用Modbus RTU主站指令库,可以读写Modbus RTU从站的数字量、模拟量I/O以及保持寄存器。
要使用Modbus RTU主站指令库,须遵循下列步骤:
安装西门子标准指令库;
按照要求编写用户程序调用 Modubs RTU 主站指令库 ;
二、主站和从站功能块
1、主站控制功能块和数据读写功能块可以参见帮助文件,写的非常详细!
三、注意及常见问题
1、MODBUS通讯是一种轮询的方式,即一次只能读取一个站的数据。所以在触发读取数据的时候要用脉冲触发,而非长期为1去触发。
2、在读取多个从站的时候,要注意每个站的轮询,轮询程序没做好,将导致通讯超时得错误,从而无法读取数据。
3、参数设计的时候,奇偶校验,通讯速率得一致,站地址不能有冲突。
4、主站与从站的数据区必须一致。
5、详细故障可以通过程序块得故障代码查询。