间接跳转至标签
如果触发器EN处于ON状态,跳转至与s指定的区域中存储的数据编号相同的标签LBLs。
输入
存储标签编号(0至255)
编号s的范围可在0和255之间。
所有用于编程此函数的输入和输出变量已在POU头中声明。 所有编程语言使用相同的POU头。
VAR
Start: BOOL:=FALSE;
_label: INT:=1;
Counter: INT:=0;
END_VAR
当变量start设置为TRUE时,执行此函数。
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_F,F19_SJP!,Instance,9,0,15,4,);
B(B_VARIN,,_label,7,2,9,4,);
B(B_CONTACT,,Start,3,1,5,3,);
L(1,2,3,2);
L(5,2,9,2);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 3 ;
NETWORK_BODY
B(B_F,@ADD-2!,Instance,8,0,13,3,,?D?D?C);
B(B_VARIN,,Counter,6,0,8,2,);
B(B_VARIN,,1,6,1,8,3,);
B(B_VAROUT,,Counter,13,0,15,2,);
L(1,0,1,3);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := 1: ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_F,@ADD-2!,Instance,8,2,13,5,,?D?D?C);
B(B_VARIN,,Counter,6,2,8,4,);
B(B_VARIN,,1,6,3,8,5,);
B(B_VAROUT,,Counter,13,2,15,4,);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
(* if Start is true Counter will be incremented by 1, else by 2 *)
IF Start then
F19_SJP(_label);
END_IF;
Counter:=Counter+1;
LBL(1);
Counter:=Counter+1;
LD |
Start |
(* EN = start; Starting signal for the F19_SJP function. *) |
F19_SJP |
_label |
(* s = Var_0 (contains the number of the label LBL) *) |
ST |
Counter |
(* option *) |