gkket 发表于 2019-12-15 10:08:19

【西门子】用SCL语言设计的功能块,一键启停

01设计要求:
设计一个具有一键启停功能的功能块,具有以下功能:a. 一键启停,模拟一个按钮,按一下启动,再按一下停止。b. 同时具有一个按钮启动的功能,按一下启动,再按不会停止。c. 具有定时停机的功能,按照设定好的时间自动停机。d. 具有复位功能。
02添加FB块,建立变量。如下图:
http://p1.pstatp.com/large/pgc-image/024dd7e93f814036ba132d727f3e37a1

http://p1.pstatp.com/large/pgc-image/4d9916b251444e6bb13c811bc7509658


03编写程序。如下图:
http://p1.pstatp.com/large/pgc-image/d4ee0ded108047e6afa13f98c13f574c


http://p1.pstatp.com/large/pgc-image/4d9916b251444e6bb13c811bc7509658

04调用并监控。如下图:
http://p9.pstatp.com/large/pgc-image/b033a1ba8ad046919fd1062e45c155d7

http://p1.pstatp.com/large/pgc-image/4d9916b251444e6bb13c811bc7509658

http://p1.pstatp.com/large/pgc-image/c4660994243940ae9f08f9a9d79d394c

http://p1.pstatp.com/large/pgc-image/4d9916b251444e6bb13c811bc7509658

以上数据块定义了功能块的管脚全局变量。

liang 发表于 2019-12-15 10:08:19

无私奉献,好工控人,32个赞送给你!!

黑流星 发表于 2020-2-10 21:02:53

谢谢楼主

cjhen 发表于 2020-3-3 11:08:49

强烈支持楼主ing……

粒娜 发表于 2020-10-24 04:52:11

我只是路过打酱油的。

TGW 发表于 2023-7-30 17:51:03

#在这里快速回复#无私奉献,好工控人,32个赞送给你!!

qjs8848 发表于 2025-11-15 03:10:07

哈哈哈哈笑不活,楼主这脑洞绝了!

青岛攻城狮 发表于 2025-11-15 03:16:24

学到干货了,感谢分享,已火速收藏

李冰比 发表于 2025-11-15 03:21:09

说得对!狠狠赞同,没毛病~

袁静 发表于 2025-11-16 00:24:47

楼主辛苦啦,期待下一篇分享
页: [1] 2
查看完整版本: 【西门子】用SCL语言设计的功能块,一键启停