thkfighter 发表于 2017-9-18 14:58:07

【已解决】Error 4355, 4370, 4371: A transition may not have any side eff...

本帖最后由 thkfighter 于 2017-9-22 20:31 编辑

【问题】
软件:CoDeSys V2.3,
例题:《IEC61131-3编程语言及应用基础》5.4.2交通信号控制系统,
PLC_PRG采用IEC-Steps SFC编写。
编译错误:
Transition T002
Error 4355: A transition may not have any side effects (Assignments, FB-Calls etc.)

Transition T002第3行
Error 4370: PLC_PRG (3): Superfluous lines found after correct IL-transition.

Transition T001第1行
Error 4371: Transition T001 (1): Invalid characters following valid expression: 'T001 := START;"

帮助文档里有错误代码解释,但很简略。我没找到解决办法。请大家帮忙看看。
T001T001 := START;
T002 STTON_2.IN
LDT#8S
STTON_2.PT
CALTON_2
LDTON_2.Q
STT002
另外,可以设置取消附件下载收费吗?


2017年9月21日
【线索一】
官网文档Comparison_CODESYS_V2_to_V3.PDF,V2.3没有V3.5强大。此程序稍作修改即可在V3.5上运行。【线索二】
CoDeSys V2.3帮助文档Transition/ Transition condition一节:A transition condition must have the value TRUE or FALSE. Thus itcan consist of either a boolean variable, a boolean address or a booleanconstant. It can also contain a series of instructions having a boolean result,either in ST syntax (e.g. (i<= 100) AND b) or in any language desired (see'Extras' 'Zoom Action/Transition'). But a transition may notcontain programs, function blocks or assignments!
CoDeSys V3.5帮助文档:CODESYSDevelopment System > Reference, Programming > Programming Languages andtheir Editors > . Sequential Function Chart (SFC) > Elements > SFCElements 'Step' and 'Transition' As opposed to CoDeSys V2.3, nowCODESYS treats a transition condition like a method call. The entry has the following syntax: <transitionname>:=<transition condition> (forexample trans1:= a=100) or only<transitioncondition> (forexample a=100)
2017年9月21日20:11
暂时两种解决方法:
方法一:迁就一下codesys v2.3,SFC transition用LD或FBD,不要coil和assignments,可以运行。但是IL和ST,未找到可变通的方法。

方法二:
在step的action中增加transition的语句,参考EPEC multitool或HydraForce backbone生成codesys模板中PLC_PRG的SFC。


无心飞扬 发表于 2017-9-19 08:29:12

变量类型需要转换。

thkfighter 发表于 2017-9-19 09:40:43

无心飞扬 发表于 2017-9-19 08:29
变量类型需要转换。

重新编辑了帖子。 麻烦再看一下。

codes 发表于 2017-10-27 11:58:52

正在学习中!!!!
页: [1]
查看完整版本: 【已解决】Error 4355, 4370, 4371: A transition may not have any side eff...