PLC SCL保持变量为真
因此,我正在用SCL语言编写PLC代码,我想知道这件事:
我有一个带有入口的坦克和一个用于流出的泵。可以说,泵只能在储罐中的水平超出水平之后运行,可以说10米。它应该继续前进,直到坦克水平下降到4米为止。
不确定我是否应该使用更多if语句或可能使用的语句?问题是,如何在之后保持泵的运转 水平已经低于10米但尚未达到4米?
该代码可能没有用:
IF (TankLevel > 10) THEN
StartPump := TRUE;
END_IF;
对任何帮助表示赞赏。
So I am writing a PLC code in SCL language and I am wondering about this thing:
I have a tank with an inlet and a pump for flow out. The pump should only run after the level in the tank goes beyond a level, lets say 10 meters. And it should keep going until the tank level goes down to 4 meters.
Not sure if I should use more IF statements or maybe a WHILE statement?. Problem is, how to keep the pump going after the level has gone under 10 meters but not yet reached 4 meters?
This code would probably not be useful:
IF (TankLevel > 10) THEN
StartPump := TRUE;
END_IF;
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
添加
elsif
PLC程序基本上是一个大
,而
循环,因此可以每隔几毫秒对此进行检查。Add an
elsif
A PLC program is basically one big
while
loop, so this can be checked every few milliseconds.只需添加以下内容:
Just add the following:
另一个选项,尽管这更适合梯子逻辑:
启动泵位将以10m的形式“锁定”,直到4m发行。
Another option, although this is more suited to ladder logic:
The StartPump bit will be "latched" at 10m until it is released at 4m.