gpt4 book ai didi

PLC:功能 block 中的 If Then Else

转载 作者:行者123 更新时间:2023-12-04 19:20:32 25 4
gpt4 key购买 nike

我正在尝试通过为 Bosch/Rexroth MLC 编程来学习。我写了这个序列,但我不确定是否有更好的方法。

伪代码看起来像这样:

wRunningCount=300
wStandstillCount=150
wCount
zeroSpeed
IF zeroSpeed THEN
wCount=wStandstillCount
ELSE
wCount=wRunningCount
FI

但我想将此功能移动到功能 block 中。 (已经有一个 TON 将接收 wCount)

现在我有:

                  __MOVE____
zeroSpeed-|EN ENO|-
wStandStillCount-|_________|-wCount


__MOVE___
zeroSpeed-o|EN ENO|-
wRunningCount-|_________|-wCount

有更好的方法吗?

最佳答案

这取决于你想如何初始化你的变量

enter image description here

否则没有比现在更好的方法了。

关于PLC:功能 block 中的 If Then Else,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34413515/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com