故事很长
发表于 2020-7-12 22:08:33
hxmuii
发表于 2020-7-20 15:02:07
谢谢楼主分享
飞机啊zdw
发表于 2021-3-8 11:13:36
学习学习,感谢楼主
寒江雪
发表于 2021-3-11 22:20:46
谢谢分享
zzhbeyond
发表于 2021-4-9 11:56:26
看看工程机械的资料
犀利哥追梦人
发表于 2021-4-30 00:14:20
这个可可以有。哈哈
大志
发表于 2021-5-11 12:09:45
看看看可
momomo
发表于 2021-6-1 11:26:47
1111111111111111111111111111111111
雪飞舞
发表于 2021-10-20 05:12:42
学习学习
焕游仁阿生
发表于 2024-3-21 19:20:15
好东西学习声明
FUNCTION_BLOCK FB_BubbleSortMethod_1
VAR_INPUT
EN:BOOL;//ENABLE
moderder_mode;
data_IN:ARRAY OF INT;
END_VAR
VAR_OUTPUT
ENO:BOOL;//out
data_OUT:ARRAY OF INT;
END_VAR
VAR
ARR:ARRAY OF INT;
N: INT;
I: INT;
M: INT;
J: INT;
T: int;
END_VAR
程序
ENO:=EN;
ARR:=data_IN;
IF EN THEN
IF MODE=InvertedSequence THEN
FOR N:=0 TO 9 BY 1 DO
IF I<9-N THEN I:=9-N; END_IF
FOR M:=0 TO i-1 BY 1 DO
J:=M+1;
IF ARR>ARR THEN
T:=ARR;
ARR:=ARR;
ARR:=T;
END_IF
END_FOR
END_FOR
ELSIF MODE=seriation THEN
FOR N:=0 TO 9 BY 1 DO
IF I<9-N THEN I:=9-N; END_IF
FOR M:=0 TO i-1 BY 1 DO
J:=M+1;
IF ARR<ARR THEN
T:=ARR;
ARR:=ARR;
ARR:=T;
END_IF
END_FOR
END_FOR
END_IF
END_IF
IF NOT EN THEN
data_OUT:=
data_OUT:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=0;
END_IF
data_OUT:=ARR;声明
FUNCTION_BLOCK FB_BubbleSortMethod_1
VAR_INPUT
EN:BOOL;//ENABLE
moderder_mode;
data_IN:ARRAY OF INT;
END_VAR
VAR_OUTPUT
ENO:BOOL;//out
data_OUT:ARRAY OF INT;
END_VAR
VAR
ARR:ARRAY OF INT;
N: INT;
I: INT;
M: INT;
J: INT;
T: int;
END_VAR
程序
ENO:=EN;
ARR:=data_IN;
IF EN THEN
IF MODE=InvertedSequence THEN
FOR N:=0 TO 9 BY 1 DO
IF I<9-N THEN I:=9-N; END_IF
FOR M:=0 TO i-1 BY 1 DO
J:=M+1;
IF ARR>ARR THEN
T:=ARR;
ARR:=ARR;
ARR:=T;
END_IF
END_FOR
END_FOR
ELSIF MODE=seriation THEN
FOR N:=0 TO 9 BY 1 DO
IF I<9-N THEN I:=9-N; END_IF
FOR M:=0 TO i-1 BY 1 DO
J:=M+1;
IF ARR<ARR THEN
T:=ARR;
ARR:=ARR;
ARR:=T;
END_IF
END_FOR
END_FOR
END_IF
END_IF
IF NOT EN THEN
data_OUT:=
data_OUT:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=
data_out:=0;
END_IF
data_OUT:=ARR;