为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

如何仿真两个 CPU 模块间的通讯

2010-09-09 6页 pdf 231KB 30阅读

用户头像

is_783808

暂无简介

举报
如何仿真两个 CPU 模块间的通讯 Service & Support www.4008104288.com.cn (填写文档类型:常问问题) P1-6 如何仿真两个 CPU 模块间的通讯。 说明: 从 S7-PLCSIM V5.4+SP3 开始,用户可以使用 S7-PLCSIM 在一个 STEP 7 项目中同时仿真多 CPU 并建立 CPU 间的通讯。下面的通讯块可用于仿真通讯: • SFB8 "USEND" • SFB9 "URCV" • SFB12 "BSEND" • SFB13 "BRCV" • SFB1...
如何仿真两个 CPU 模块间的通讯
Service & Support www.4008104288.com.cn (填写文档类型:常问问) P1-6 如何仿真两个 CPU 模块间的通讯。 说明: 从 S7-PLCSIM V5.4+SP3 开始,用户可以使用 S7-PLCSIM 在一个 STEP 7 项目中同时仿真多 CPU 并建立 CPU 间的通讯。下面的通讯块可用于仿真通讯: • SFB8 "USEND" • SFB9 "URCV" • SFB12 "BSEND" • SFB13 "BRCV" • SFB15 "PUT" • SFB14 "GET" • SFB19 "START" • SFB 20 "STOP" • SFB 22 "STATUS" • SFB 23 "USTATUS" 通讯过程中,有可能存在时间性问题,因为 S7-PLCSIM 不支持实时。 也可参考 S7-PLCSIM 自述文件中 7.3 节的信息。 如果运行大量 Windows 程序时,用户不能启动任何 其它程序或不能打开任何窗口,那么必须改变计算机操作系统的 “ 桌面堆存储器” 属性。 一种解决方 法在表 02 中描述。 用户不能用真实 CPU(PLC) 和 S7-PLCSIM 同时测试一个 STEP 7 项目中的程序。如果用户希望用 S7-PLCSIM 仿真 CPU,那么必须断开和实际 CPU 的所有连接。 下面的表 01 描述了同时仿真多 CPU 的过程。 No. 步骤: 1 在 SIMATIC Manager 中打开 S7-PLCSIM ,或者通过菜单命令 “ Options > Simulate Modules ” 或者点击菜单工具条中 “ Simulation on/off ” 图表。带有实例标签 “ S7-PLCSIM1 ” 的第一个被 仿真 CPU 的对话框被打开。 2 在“ S7-PLCSIM1 ” 对话框中,用户从下拉框中选择被组态的接口类型作为 PG/PC 接口。 默认 为 MPI 接口。然后,S7-PLCSIM 以最后使用的接口启动。然而,根据硬件组态,也可以设定 为 “ PROFIBUS ”,“ TCP/IP ” ( 通过 IP 地址 ),“ ISO ” ( 通过 MAC 地址 ) 或者 “ Local ” ( 通过 虚拟背板总线 ) 接口。 注意: 用户必须避免在同一网络中的站地址重复。如果通过 MPI 接口装载所有站的程序,那么硬件组 态中的地址被分配如下: • 站 1:MPI 地址: 2 • 站 2:MPI 地址: 3 • 等等。 3 在 SIMATIC Manager 中, 选中第一个 S7 站的块文件夹并装载到 S7-PLCSIM1 中,通过菜单 命令 “ PLC > Upload ”。 4 在 S7-PLCSIM 的 “ CPU ” 子窗口中,改变操作模式从“ STOP ” 到 “ RUN-P ”。通过 “ 添加” 菜 单,可以增加输入、输出、标志等子窗口来监视并控制程序。 5 为了仿真其它 CPU,用户在 S7-PLCSIM 中执行菜单命令 “ Simulation > New PLC ”。“ S7- PLCSIM2” 对话框打开。 6 为了仿真第二个 CPU,需要在硬件组态中配置接口参数 ( PG/PC interface )。 图. 01 展示了仿 真两个 S7-400 CPU 通讯的例子。在 S7-PLCSIM1 (仿真站 1)中, EB1 控制计数器 Z1 然后发 送计数值到 S7-PLCSIM2 (仿真站 2) 的 AW1 中。 Service & Support 图. 01 注意: 如果在两个 CPU 中使用相同的接口和地址,那么下拉菜单的选项将是灰色的,S7-PLCSIM 将 不能通过这个接口被访问。通过 PG/PC 接口的下拉菜单选择这个接口即使它已经被选择。然后 颜色从灰色改变为黑色并且 S7-PLCSIM 可以通过这个接口被访问。 7 在 SIMATIC Manager 中,选择第二个 CPU 的块文件夹并装载块到实例 “ S7-PLCSIM2” 中。 在装载之前必须打开 “ S7-PLCSIM2 ”。现在同样添加输入、输出、标记等子窗口。 注意: 仅当接口颜色为黑色时执行下载功能 ( 见第 6 步所述 )。 更多信息参考 S7-PLCSIM 自述文件 第 7.3.2 节. 如要仿真其它 CPU 则重复 4 到 7 步。 表 01 改变操作系统属性 “桌面堆存储器” 当运行大量 Windows 程序时,即使用户电脑中有足够的主存储器和虚拟内存,也可能得到错误信 息 “ 没有足够的主内存” 或程序可能冲突。 一种解决方法在表 02 中被描述。 No. 步骤: 1 开启注册表通过 “ 开始 〉运行...” 并在命令行输入 “ Regedt32.exe ”。 2 打开路径: • HKEY_LOCAL_Machine\System\CurrentControlSet\Control\Session Manager\SubSystems 3 在 “ Windows ” 上点击鼠标右健并在弹出的菜单中选择 “ Change” 功能。“ Edit String ” 对话框 将被打开。 4 “ SharedSection ” 参数有值 1024 ( 系统堆的最大值 ) 和 3072 ( 每个桌面堆的值 )。通过添加值 512 到 “ SharedSection” 参数来增加 512 KB 桌面堆存储器,如下图 图. 02 所示。 然后点击 www.4008104288.com.cn (填写文档类型:常问问题) P2-6 Service & Support “ OK ” 来保存设定。 图. 02 SharedSection 带有附加值 512 KB 的桌面堆的大小被定义到每个桌面,用来连接一个“非交互 式”工作站。上面涉及的错误信息或程序冲突应该不再发生。 5 用户必须重启计算机来改变桌面堆存储器。 注意: 更多信息请关注互联网 Microsoft 帮助和支持页面下的文章 ID: KB126962。 表 02 关键词: Out of memory, Multi-instance 条目号:38726591 日期:2009-12-31 Scroll down for English: How do you simulate communication between two CPU modules? Instructions: As from S7-PLCSIM V5.4 + SP3 you can use S7-PLCSIM to simulate multiple CPU modules simultaneously in a STEP 7 project and establish communication between the CPU modules. The following communication blocks are supported for communication: • SFB8 "USEND" • SFB9 "URCV" • SFB12 "BSEND" • SFB13 "BRCV" • SFB15 "PUT" • SFB14 "GET" www.4008104288.com.cn (填写文档类型:常问问题) P3-6 Service & Support www.4008104288.com.cn (填写文档类型:常问问题) P4-6 • SFB19 "START" • SFB 20 "STOP" • SFB 22 "STATUS" • SFB 23 "USTATUS" During communication, there might be time restrictions because S7-PLCSIM does not support real time. Please also refer to the information in the S7-PLCSIM readme file, section 7.3. If, when running a large number of Windows programs, you cannot start any more programs or you cannot open any more windows, then you must change the operating system property "desktop heap memory" of your PC. One remedy is described in Table 02. You cannot test a program of your STEP 7 project with a real CPU (PLC) at the same time as a program with S7-PLCSIM. If you wish to simulate your CPUs with S7-PLCSIM, you must first disconnect all connections to the real CPU. Proceed as described in Table 01 below to simulate multiple CPU modules simultaneously. No. Procedure: 1 Open S7-PLCSIM in the SIMATIC Manager, either via the menu command "Options> Simulate Modules" or from the menu bar with the "Simulation on/off" icon. The dialog with the instance number "S7-PLCSIM1" with the first simulated CPU opens. 2 In the "S7-PLCSIM1" dialog, you select the configured interface parameterization from the drop-down list box for the PG/PC interface. The MPI interface is preset by default. Later, S7- PLCSIM starts with the interface last used. However, depending on your hardware configuration, you can also set the "PROFIBUS", "TCP/IP" (via the IP address), "ISO" (via the MAC address) or "Local" (via the virtual backplane bus) interface. Note: You must not use the addresses more than once in the same subnetwork. If you load all your programs via the MPI interface, for example, then the different MPI addresses might look like this: • Station 1: MPI address: 2 • Station 2: MPI address: 3 • etc. 3 In the SIMATIC Manager, mark the block folder of your first S7 station and load your blocks in S7-PLCSIM1 via the menu command "PLC > Upload". 4 In the "CPU" subwindow in S7-PLCSIM, change the operating mode from "STOP" to "RUN-P". Via the "Add" menu, you can upload the subwindows for the inputs, outputs, markers... in order to monitor and control the program. 5 To simulate another CPU, you execute the menu command "Simulation > New PLC" in S7- PLCSIM. The "S7-PLCSIM2" dialog opens. 6 For the second CPU to be simulated, you select the interface parameterization (PG/PC interface) configured in the hardware configuration. Fig. 01 shows an example of communication between two S7-400 CPU modules. In S7-PLCSIM1 (simulation for Station 1), EB1 controls counter Z1 and transfers the counter value to the AW1 in S7-PLCSIM2 (simulation for Station 2). Service & Support Fig. 01 Note: If you use the same address of the same interface for both CPUs, the item in the drop-down list is grayed. The S7-PLCSIM instance is not accessible via this interface. Select the interface from the drop-down list box for the PG/PC interface even if it is already set. Then the color changes from gray to black and the S7-PLCSIM instance is accessible via this interface. 7 In the SIMATIC Manager, mark the block folder of your second CPU and load all the blocks into the instance "S7-PLCSIM2". You must select the instance "S7-PLCSIM2" before loading. Here, too, you add the subwindows required for the inputs, outputs, markers... . Note: Execute the download only when the color of the interface is black (as described in Step 6 above). More information is available in the S7-PLCSIM readme in section 7.3.2. Repeat steps 4 to 7 for every other CPU to be simulated. Table 01 Changing the operating system property "desktop heap memory" Even if you have sufficient main memory and export memory in your PC, you might get the error message "Not enough main memory" or the program might crash when running a large number of Windows programs. One remedy is described in Table 02. No. Procedure: 1 Start the registry editor via "Start > Run..." and by entering "Regedt32.exe" in the command line. 2 Open the path: • HKEY_LOCAL_Machine\System\CurrentControlSet\Control\Session Manager\SubSystems 3 Right-click on "Windows" and select the "Change" function in the pop-up menu. The "Edit String" dialog opens. 4 The "SharedSection" parameter has the values 1024 (maximum size of the system-wide www.4008104288.com.cn (填写文档类型:常问问题) P5-6 Service & Support heap) and 3072 (size of the heap per desktop). Increase the desktop heap memory by 512 KB by adding the value 512 to the "SharedSection" parameter as shown in Fig. 02. Then click "OK" to save the settings. Fig. 02 With the additional SharedSection value of 512 KB, the size of the desktop heap is defined for each desktop that is connected to a "non-interactive" workstation. Display of the above- mentioned error message or program crashes should now no longer occur. 5 You must reboot your PC to make the changes to the desktop heap memory effective. Note: More information is available in the Internet on the Microsoft Help and Support page under article ID: KB126962. Table 02 Keywords: Out of memory, Multi-instance Entry ID:38726591 Date:2009-12-14 www.4008104288.com.cn (填写文档类型:常问问题) P6-6
/
本文档为【如何仿真两个 CPU 模块间的通讯】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索