图 1: 循环周期的过程顺序
S7-PLCSIM 与“实际”的自动化系统还有以下不同:
诊断缓冲区:S7-PLCSIM 不能支持写入诊断缓冲区的所有错误消息。例如,关于 CPU 中的电池电量不足的消息或者 EEPROM错误是不能仿真的。但大部分 I/O 和程序错误都是可以仿真的。
在改变运行模式时(比如从 RUN 切换到 STOP)输入输出不会被置为“安全”状态。
不支持功能模块(FM)。
不支持 点对点通信(例如同一机架上的两个 S7-400 CPU 之间)。
S7-PLCSIM 与 S7 400 CPU 一样支持 4 个电池。在某些情况下,在 S7-PLCSIM上用4个电池的运行状态可能不同于在S7-300 CPU上仅用两个电池的运行状态。
输入/输出的不同
大多数 S7-300 系列的 CPU 可以自动配置IO:当一个模块插入到控制器时,CPU会自动的识别此模块。这种自动配置功能不能在仿真的自动化系统上仿真。如果您从S7-300CPU中加载程序,会自动配置IO到S7-PLCSIM中,系统数据不会包括IO配置。因此,在使用S7-PLCSIM仿真S7-300的时候,您必须先装载硬件组态来定义哪个CPU模块是可供使用的。
为了下载硬件配置到S7-PLCSIM,您需要给不能自动配置IO的S7-300 CPU(如S7-315-2DP,S7-316-2DP或S7-318-2)创建一个项目。拷贝相应的硬件配置到这个项目中,并装载到 S7-PLCSIM。之后您就可从任意S7 项目装载程序块,并且可完美地控制I/O 。
S7-PLCSIM 的功能
S7-PLCSIM 仿真 S7 控制器并包含下述存储区:
存储区 | 描述 |
定时器 | T0到T2047 |
计数器 | Z0到Z2047 |
标志位 | 标志位存储区 131.072 位 (16 KB) |
总输入输出寻址存储区 | 输入输出存储区 262.136位 (32 KB) |
过程映像区(可调整;每个循环更新) |
Zui大: 131.072 位 (16 KB) |
本地数据 (可调整) | Zui大: 32 KB |
数据块 | 2048 功能块 (FB) 和功能 (FC) Zui大数:65534 4095数据块(DB)Zui大长度:65570 |
系统功能块(SFBs) | SFB0, SFB1, SFB2, SFB3, SFB4, SFB5, SFB8, SFB9, SFB12, SFB13,SFB14, SFB15, SFB19, SFB20, SFB22, SFB23, SFB31, SFB32, SFB33,SFB34, SFB35, SFB36, SFB37, SFB52, SFB53 and SFB54 |
系统功能 (SFCs) | SFC0, SFC1, SFC2, SFC3, SFC4, SFC5, SFC6, SFC9, SFC10, SFC11,SFC12, SFC13, SFC14, SFC15, SFC17, SFC18, SFC19, SFC20, SFC21,SFC22, SFC23, SFC24, SFC26, SFC27, SFC28, SFC29, SFC30, SFC31,SFC32, SFC33, SFC34, SFC36, SFC37, SFC38, SFC39, SFC40, SFC41,SFC42, SFC43, SFC44, SFC46, SFC47, SFC49, SFC50, SFC51, SFC52,SFC54, SFC55, SFC56, SFC57, SFC58, SFC59, SFC62, SFC64, SFC78,SFC79, SFC80, SFC82, SFC83, SFC84, SFC85, SFC87, SFC90, SFC105,SFC106, SFC107 and SFC108 对于SFC26 and SFC27来说0是唯一支持的输入参数。 |
组织块(OBs) | OB1 (free cycle) OB10 to OB17 (time-of-day interrupt) OB20 to OB23 (delay interrupt) OB30 to OB38 (cyclic interrupt) OB40 to OB47 (process alarm) OB55 (status interrupt) OB56 (interrupt update) OB57 (manufacturer-specific interrupt) OB60 (multiprocessor interrupt) OB61 to OB64 (synchronous cycle interrupt) OB65 (Technology synchronization interrupt) OB70 (IO redundancy error) OB72 (CPU redundancy error) OB73 (communication error) OB80 (time error) OB82 (diagnostics interrupt) OB81 (power supply failure) OB83 (remove/plug alarm) OB84 (CPU hardware error) OB85 (program execution error) OB86 (subrack failure) OB87 (communication error) OB88 (processing alarm) OB90 (background OB) OB100 (restart) OB101 (hot restart) OB102 (cold restart) OB121 (programming error) OB122 (IO access error) |
请注意以下SFB,SFC 和OB 将作为 NOP 语句执行(空操作)。程序中调用的 NOP 不能修改。
SFB12, SFB13, SFB14, SFB15, SFB19, SFB20, SFB22 和 SFB23,
SFC11, SFC36, SFC37, SFC38 和 SFC62
OB81, OB84, OB87 和 OB90