# 功能块图

**功能块图**（FBD）是一种用于可编程逻辑控制器（PLC）的图形化编程语言，其做法是在一块画布上将函数与功能块连接起来，使控制逻辑表现为数据从输入出发、经过处理块、最终到达输出的流动过程。<sup>[1](https://intelligentintegrators.org/learn-function-block-diagram/)</sup> 它是国际标准 [IEC 61131-3](https://www.edgepedia.org/zh/iec-61131-3) 所定义的编程语言之一，与梯形图（LD）、结构化文本（ST）并列，在较早的版本中还包括指令表（IL）。<sup>[2](https://webstore.iec.ch/en/publication/4552)</sup>

| 关键事实 | 详情 |
|---|---|
| 标准 | IEC 61131-3《可编程控制器——第3部分：编程语言》所定义的图形化语言之一<sup>[2](https://webstore.iec.ch/en/publication/4552)</sup> |
| 模型 | 数据流或信号流：带有输入、输出引脚的块由承载类型化数值的连线相连<sup>[1](https://intelligentintegrators.org/learn-function-block-diagram/)</sup> |
| 执行 | 通常从左到右，但也可根据块的摆放位置上下运行<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup> |
| 典型用途 | 连续过程控制：模拟量缩放、滤波器、PID 回路以及可复用的设备模块<sup>[4](https://www.plcsimulationsoftware.com/blog/ladder-logic-vs-function-block)</sup> |
| 地区格局 | 北美历来首选梯形图，而功能块图在欧洲更为常见<sup>[5](https://nivelco.com.ua/documents/technical%20publications%20docs/Instrument%20Engineers%20Handbook%2C%20Volume%203%20Process%20Software%20and%20Digital%20Networks%2C%20Fourth%20Edition%20%28Volume%203%29.pdf)</sup> |
| 现行版本 | IEC 61131-3:2025（4.0 版）将 ST 列为文本语言，将 LD 与 FBD 列为图形语言，并以顺序功能图（SFC）元素进行结构化组织<sup>[6](https://webstore.iec.ch/en/publication/68533)</sup> |

## 功能块图程序的工作原理

功能块图程序通过拖拽、放置和连接功能块与变量来构建。连线与标志代表变量，每个块对其输入执行既定运算，并将结果传送到输出。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup> IEC 61131-3 的定义将这种语言描述为：以图形方式连接函数与功能块，通过数据流动来表达控制逻辑。<sup>[1](https://intelligentintegrators.org/learn-function-block-diagram/)</sup>

其视觉效果类似化学与过程工程中使用的方块流程图——生产过程被画成若干方块，分别代表输入、变换与输出。PLC 功能块图的工作原理与之相同：多个输入进入指令块，指定的输出随之改变。<sup>[7](https://www.solisplc.com/tutorials/function-block-programming)</sup> 由于布局可以模拟物理过程，即使没有 PLC 编程背景的人也能读懂图意。<sup>[7](https://www.solisplc.com/tutorials/function-block-programming)</sup>

**功能块作为可复用单元。** 功能块是一种程序组织单元，可用任何 IEC 支持的语言编写。参数传入，逻辑执行，输出变量被设定或数据被传出。其目的在于减少重复代码：一个经过调试的块——例如触发相机并报告错误标志与检测结果的块——可以为系统中的每台相机各实例化一次。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup> 标准块包括逻辑门（AND、OR、NOT）、定时器、计数器、PID 控制器、数学运算与比较功能。<sup>[8](https://nfmconsulting.com/knowledge/ladder-logic-vs-structured-text/)</sup>

执行顺序遵循所画的连接关系，通常从左到右，但也可根据摆放位置上下运行。函数可以并行运行，但执行速率不同；复杂的自定义块每次调用的耗时比简单块更长。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup>

## 功能块图在 IEC 语言体系中的位置

IEC 61131-3 定义了一套面向不同控制问题的语言，实际生产应用通常混用多种语言。<sup>[9](https://www.instrumentationblog.in/iec-61131-3-programming-languages/)</sup> 通常的分工是：

- **梯形图**用于离散布尔逻辑，如联锁、允许条件、启停自保持和继电器替代电路，因为维护技术人员无需成为程序员即可读懂梯形图梯级。<sup>[4](https://www.plcsimulationsoftware.com/blog/ladder-logic-vs-function-block)</sup>
- **功能块图**用于信号路由与处理：模拟量缩放、滤波、与限值比较以及 PID 回路控制，这些场合数据在块与块之间的流动清晰可见。<sup>[4](https://www.plcsimulationsoftware.com/blog/ladder-logic-vs-function-block)</sup>
- **结构化文本**用于计算、算法与数据处理。<sup>[8](https://nfmconsulting.com/knowledge/ladder-logic-vs-structured-text/)</sup>
- **顺序功能图**用于组织分步执行的顺序流程。<sup>[6](https://webstore.iec.ch/en/publication/68533)</sup>

两种图形语言本身并无快慢、安全或可移植性上的优劣；编译实现、任务配置、库与设计质量才决定这些结果。<sup>[10](https://plcprogramming.io/blog/ladder-logic-vs-function-block-diagram-comparison)</sup> 功能块图与过程工程的工作流程天然契合，因为其信号路径类似于 P&ID（管道及仪表流程图）的思维方式。<sup>[11](https://industrialmonitordirect.com/blogs/knowledgebase/structured-text-and-function-block-vs-ladder-logic-when-to-use-each)</sup> 在应用 [ISA-88](https://www.edgepedia.org/zh/isa-88) 标准的批处理控制概念时，它也被认为十分有用。<sup>[12](https://www.plcacademy.com/function-block-diagram-programming/)</sup>

地区实践存在差异。在北美，梯形图历来是 PLC 编程的首选语言，而功能块图在欧洲更为常见。<sup>[5](https://nivelco.com.ua/documents/technical%20publications%20docs/Instrument%20Engineers%20Handbook%2C%20Volume%203%20Process%20Software%20and%20Digital%20Networks%2C%20Fourth%20Edition%20%28Volume%203%29.pdf)</sup>

## 应用

功能块图适用于控制问题本身就是一条连通信号路径的领域。过程自动化使用方块图来设计与解释事件与其他过程之间共享数据的过程，因此编程风格与设计图纸相一致。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup> 安全系统常用功能块图程序，因为它们易于阅读，而可读性可以降低逻辑出错的余地——这类逻辑一旦失效可能造成人身伤害。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup> 多个 PID 回路在功能块图中表现良好，因为在功能块图中，并行过程比在顺序代码中更容易跟踪。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup> 重复性代码受益于拖入经过验证、调试过的块，协作机器人制造商便采用这一做法来减少车间培训需求。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup>

在分布式控制系统（DCS）中，功能块通常以标准块的形式提供，执行 PID 控制与布尔逻辑等常见功能。<sup>[5](https://nivelco.com.ua/documents/technical%20publications%20docs/Instrument%20Engineers%20Handbook%2C%20Volume%203%20Process%20Software%20and%20Digital%20Networks%2C%20Fourth%20Edition%20%28Volume%203%29.pdf)</sup> 市场上的工程工具普遍支持这种语言；例如 ABB 的 Freelance 工程工具支持包括 FBD 在内的全部五种 IEC 61131-3 语言。<sup>[13](https://www.abb.com/global/en/areas/automation/control-systems/freelance/engineering)</sup>

## 标准化历史

图形化的理念早于 PLC 标准：1977 年出现了德国功能块图标准 DIN 40 719-6，国际上与 IEC 848 相关联。<sup>[14](https://lca.poli.ufrj.br/wp-content/uploads/2017/04/IEC61131-3_Programming_Industrial_Automation_Systems.pdf)</sup> IEC 61131-3 于 1993 年首次发布。<sup>[9](https://www.instrumentationblog.in/iec-61131-3-programming-languages/)</sup> 第三版于 2013 年 2 月 20 日发布，作为兼容性扩展取消并取代了 2003 年的第二版，新增了数据类型与转换函数、引用、命名空间，以及类与功能块的面向对象特性。<sup>[2](https://webstore.iec.ch/en/publication/4552)</sup> 第四版 IEC 61131-3:2025 于 2025 年 5 月 22 日发布，描述了一套统一的语言套件，由文本语言结构化文本与图形语言梯形图、功能块图组成，并以 SFC 元素组织程序与功能块；该版新增了 UTF-8 字符串，并列出了相对于 2013 版新增、删除或弃用的特性。<sup>[6](https://webstore.iec.ch/en/publication/68533)</sup>

另一项独立标准 [IEC 61499](https://www.edgepedia.org/zh/iec-61499) 规定了面向工业过程控制的、以功能块为导向的范式，将块的概念扩展到分布式系统。<sup>[5](https://nivelco.com.ua/documents/technical%20publications%20docs/Instrument%20Engineers%20Handbook%2C%20Volume%203%20Process%20Software%20and%20Digital%20Networks%2C%20Fourth%20Edition%20%28Volume%203%29.pdf)</sup>

## 实践要点

功能块图程序在保持简单时易于阅读，而当许多功能挤在一起、连线交叉时则难以跟踪。推荐做法包括：在画布上把功能铺开，并将分支输出连接的数量控制在不超过三个，以减少杂乱与复杂度。<sup>[3](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)</sup> 整个流程很少单独用功能块图编写；布局会变得复杂而难以管理，因此这种语言最常与梯形逻辑或结构化文本配合使用。<sup>[7](https://www.solisplc.com/tutorials/function-block-programming)</sup>

## References

1. [Learn the Basics of a Function Block Diagram, Intelligent Integrators](https://intelligentintegrators.org/learn-function-block-diagram/)
2. [IEC 61131-3:2013, Programmable controllers – Part 3: Programming languages, IEC Webstore](https://webstore.iec.ch/en/publication/4552)
3. [PLC Programming With Function Block Diagrams, Control.com Technical Articles](https://control.com/technical-articles/plc-programming-with-function-block-diagrams/)
4. [Ladder Logic vs Function Block Diagram: When to Use Each, PLC Simulator](https://www.plcsimulationsoftware.com/blog/ladder-logic-vs-function-block)
5. [Instrument Engineers' Handbook, Volume 3: Process Software and Digital Networks, Fourth Edition](https://nivelco.com.ua/documents/technical%20publications%20docs/Instrument%20Engineers%20Handbook%2C%20Volume%203%20Process%20Software%20and%20Digital%20Networks%2C%20Fourth%20Edition%20%28Volume%203%29.pdf)
6. [IEC 61131-3:2025, Programmable controllers – Part 3: Programming languages, IEC Webstore](https://webstore.iec.ch/en/publication/68533)
7. [Introduction to Function Block Programming in RSLogix 5000, SolisPLC](https://www.solisplc.com/tutorials/function-block-programming)
8. [Ladder Logic vs Structured Text vs Function Block, NFM Consulting](https://nfmconsulting.com/knowledge/ladder-logic-vs-structured-text/)
9. [IEC 61131-3 Programming Languages Compared, Instrumentation Blog](https://www.instrumentationblog.in/iec-61131-3-programming-languages/)
10. [Ladder Logic vs Function Block Diagram: Same PLC Task, PLC Programming IO](https://plcprogramming.io/blog/ladder-logic-vs-function-block-diagram-comparison)
11. [Structured Text and Function Block vs Ladder Logic, Industrial Monitor Direct](https://industrialmonitordirect.com/blogs/knowledgebase/structured-text-and-function-block-vs-ladder-logic-when-to-use-each)
12. [Function Block Diagram (FBD) PLC Programming Tutorial for Beginners, PLC Academy](https://www.plcacademy.com/function-block-diagram-programming/)
13. [Freelance Engineering, ABB](https://www.abb.com/global/en/areas/automation/control-systems/freelance/engineering)
14. [IEC 61131-3: Programming Industrial Automation Systems, history and components](https://lca.poli.ufrj.br/wp-content/uploads/2017/04/IEC61131-3_Programming_Industrial_Automation_Systems.pdf)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 制造系统与工业工程 › Manufacturing automation and control

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/function-block-diagram

English original: https://www.edgepedia.org/function-block-diagram
