FUNCTION_BLOCK Mould_connect_FB
TITLE = 'Mould_connect_FB'
VERSION : '1.0'
AUTHOR : X
NAME : FB_106
FAMILY : YZ
VAR
MCPNr :INT ;
END_VAR
CONST
MCPAnz := 42 ;
END_CONST
BEGIN
FOR MCPNr := 1 TO MCPAnz BY 1 DO
IF "Plant_Comm_Ethernet".Comm_with_Plant[ MCPNr ] =0 THEN
"Mark_DB".MARK[ MCPNr ].LEFT=0
"Mark_DB".MARK[ MCPNr ].MID=0
"Mark_DB".MARK[ MCPNr ].RIGHT=0
END_IF
END_FOR
END_FUNCTION_BLOCK
问题补充:
编译出错在最后一行 “END_FUNCTION_BLOCK”
图片说明:
最佳答案
STEP7的SCL没用过,程序里这些不用加分号么?
FOR MCPNr := 1 TO MCPAnz BY 1 DO
IF "Plant_Comm_Ethernet".Comm_with_Plant[ MCPNr ] =0 THEN
"Mark_DB".MARK[ MCPNr ].LEFT=0 ;
"Mark_DB".MARK[ MCPNr ].MID=0 ;
"Mark_DB".MARK[ MCPNr ].RIGHT=0;
END_IF;
END_FOR;
提问者对于答案的评价:
已解决,还是格式的问题,谢谢!
原创文章,作者:ximenziask,如若转载,请注明出处:https://www.zhaoplc.com/plc349400.html