- 西门子S7-1500 PLC 从入门到精通
- 李方园
- 2325字
- 2025-02-18 01:50:02
2.3 I/O模块的硬件配置
2.3.1 数字量输入模块的硬件配置
以如图2-34所示的数字量输入DI 32×24VDC BA模块(6ES7521-1BL10-0AA0)为例,它可以组态为3种形式,见表2-2。

图2-34 DI 32×24VDC BA模块
表2-2 DI 32×24VDC BA模块的组态形式

在正常情况,即在如图2-34所示的配置情况下,一般组态为1×32通道DI 32×24VDC BA的地址空间。图2-35显示了组态为1×32通道模块的地址空间分配。模块的起始地址可任意指定。通道的地址将从该起始地址开始。模块上已印刷字母a~d。例如,IB a是指模块起始地址输入字节a。

图2-35 组态为1×32 通道模块的地址空间分配
图2-36为DI 32×24VDC BA模块的“属性”→“模块参数”→“常规”界面,定义了启动的三种情况,分别是“来自CPU”“仅兼容时启动CPU”“即便不兼容仍然启动CPU”。

图2-36 DI 32×24VDC BA模块的“属性”→“模块参数”→“常规”界面
图2-37为DI 32×24VDC BA模块的组态情况。由于本次组态为主控制器,不是PROFINET IO,因此“子模块的组态”(“模块分配”)显示灰色,“共享设备的模块副本(MSI)”显示灰色。本次组态为连续的32个输入,其地址可以任意指定,如图2-38所示。其中本模块默认地址为I0.0~I3.7。

图2-37 DI 32×24VDC BA模块的组态情况

图2-38 “I/O地址”界面
DI 32×24VDC BA模块的另外两种组态方式请参考2.4节。
2.3.2 数字量输出模块的硬件配置
1.DQ组态地址
以如图2-39所示的数字量输出DQ 32×24VDC/0.5A HF模块(6ES7522-1BL01-0AB0)为例,它可以组态为5种形式,见表2-3。

图2-39 数字量输出DQ 32×24VDC/0.5A HF模块
表2-3 数字量输出DQ 32×24VDC/0.5A HF模块的组态形式

在正常情况,即在如图2-40所示的组态情况下,一般组态为32通道DQ 32×24VDC/0.5A HF的地址空间。如果勾选了“值状态”,则同时又具有32通道的输入。

图2-40 “DQ组态”界面
图2-41显示了组态为带“值状态”的32通道模块的地址空间分配。可任意指定模块的起始地址。通道地址将从该起始地址开始。在模块上印有字母a~d。QB a是指模块起始地址输出字节a。
图2-42为带“值状态”的I/O地址。数字量输出模块不仅有输出地址,同时还增加了输入地址。
组态为4×8通道的地址空间、组态为1×32通道MSO的地址空间请参考2.4.4节。
2.通道输出组态
图2-43为数字量输出DQ 32×24VDC/0.5A HF模块的通道模板输出组态,即在“无电源电压L+”“断路”“接地短路”下启用诊断。

图2-41 带“值状态”的32 通道模块的地址空间分配

图2-42 带“值状态”的I/O地址
图2-44为“对CPU STOP模式的响应方式”选项,可选择“关断”“保持上一个值”“输出替换值1”三种中的任一种。
以上两种设置既可以全部应用到所有32通道,也可以在每一通道中进行单独设置。图2-45是通道0的输出组态,“参数设置”可以选择“来自模板”或“手动”。

图2-43 数字量输出DQ 32×24VDC/0.5A HF模块的通道模板输出组态

图2-44 “对CPU STOP模式的响应”选项

图2-45 通道0的输出组态
当输出通道设置完毕,就可以在“输出参数”选项中看到所有的“输出参数概览”,如图2-46所示。

图2-46 “输出参数概览”界面
2.3.3 模拟量输入模块的硬件配置
1.AI组态地址
以如图2-47所示的AI 8×U/I/RTD/TC ST模块(6ES7531-7KF00-0AB0)为例,它可以组态为5种形式,见表2-4。

图2-47 AI 8×U/I/RTD/TC ST模块
表2-4 AI 8×U/I/RTD/TC ST模块的组态形式

图2-48显示了组态为带值状态的1×8通道AI 8×U/I/RTD/TC ST模块的地址空间分配。可以任意指定模块的起始地址。通道地址将从该起始地址开始。IB x是指模块起始地址的输入字节x。

图2-48 组态为带值状态的1×8 通道AI 8×U/I/RTD/TC ST模块的地址空间分配
图2-49为AI组态选择“值状态”,模块的I/O地址占用17个字节,即如图2-50所示的IB63~IB79,如果去掉“值状态”勾选,则为16个字节,即IB63~IB78。
2.AI通道输入属性
AI模块可以通过选择通道模板来设置“诊断”和“测量”属性,也可以手动设置每一个通道的“诊断”和“测量”属性。图2-51是“应用到使用模板的所有通道”选项,包括“无电源电压L+”“上溢”“下溢”“共模”等多种方式诊断电流、电压、热敏电阻、热电偶的测量输入。

图2-49 “值状态”选项

图2-50 “输入地址”选项

图2-51 “应用到使用模板的所有通道”选项
图2-52为“通道0”的“参数设置”选项,可选择“手动”或“来自模板”。

图2-52 “通道0”的“参数设置”选项
无论选择“来自模板”设置,还是选择“手动”设置,均需要对“诊断”和“测量”进行设置。以电压测量输入为例,需要在如图2-53~图2-56所示中依次通过“测量类型”“测量范围”“干扰频率抑制”和“滤波”选项进行设置。

图2-53 “测量类型”选项

图2-54 “测量范围”选项

图2-55 “干扰频率抑制”选项

图2-56 “滤波”选项
完成以上步骤后,就可以在如图2-57所示的“输入参数概览”界面中看到通道0~7的参数设置、测量类型和测量范围等信息。

图2-57 “输入参数概览”界面
2.3.4 模拟量输出模块的硬件配置
1.AQ组态地址
以如图2-58所示的AQ 8×U/I HS(6ES7532-5HF00-0AB0)模块为例,它可以通过不同方式对模块进行组态(见图2-59),有5种形式,见表2-5。

图2-58 AQ 8×U/I HS模块

图2-59 AQ 8×U/I HS模块组态
表2-5 AQ 8×U/I HS模块的组态形式

图2-60显示了组态为1×8通道模块的地址空间分配。可以在如图2-61所示中任意指定模块的起始地址。通道地址将从该起始地址开始。QB x表示模块起始地址输出字节x。

图2-60 组态为1×8 通道模块的地址空间分配
2.AQ通道输入属性
AQ模块可以选择通道模板来设置“诊断”和“输出参数”属性,也可以手动设置每一通道的“诊断”和“输出参数”属性。图2-62是“应用到使用模板的所有通道”选项,包括“无电源电压L+”“接地短路”“上溢”“下溢”等多种方式诊断电压、电流的测量输出。

图2-61 “I/O地址”选项

图2-62 “应用到使用模板的所有通道”选项
图2-63为“通道0”的“参数设置”选项,可选择“手动”或“来自模板”。

图2-63 “通道0”的“参数设置”选项
无论选择“来自模板”设置,还是选择“手动”设置,均需要对“诊断”和“输出”进行设置。以电压输出为例,需要在如图2-64~图2-66所示中依次通过“输出类型”“输出范围”和“对CPU STOP模式的响应”选项进行设置。

图2-64 “输出类型”选项

图2-65 “输出范围”选项

图2-66 “对CPU STOP模式的响应”选项