方法一:直接使用例行程式名呼叫例行程式
方法二:%呼叫
%“proc name”%呼叫例行程式
程式碼演示:
MODULE CommonMain
PROC main()
VAR num pathnum:=0;
VAR num targetnum:=0;
VAR num targettest:=10;
%"MoveRail"% 0,0; !例行程式普通引數測試
%"MoveRail"% 0\exact,0; !例行程式帶開關引數測試
%"MoveRail"% 0,0\target:=targettest; !例行程式帶可選引數測試
%"Rob1_Side"+NumToStr(pathnum,0)+"_"+NumToStr(targetnum,0)%; !常見路徑樣式呼叫測試
ENDPROC
PROC MoveRail(num movedistance\switch exact,num transdis\switch Rhome\var num target)
IF Present(exact) THEN
TPWrite"2,exact";
ELSE
IF Present(target) THEN
TPWrite"3,target:="\Num:=target;
TPWrite"1,no exact";
ENDIF
PROC Rob1_Side0_0()
TPWrite"Rob1_Side0_0";
ENDMODULE
方法一:直接使用例行程式名呼叫例行程式
方法二:%呼叫
%“proc name”%呼叫例行程式
程式碼演示:
MODULE CommonMain
PROC main()
VAR num pathnum:=0;
VAR num targetnum:=0;
VAR num targettest:=10;
%"MoveRail"% 0,0; !例行程式普通引數測試
%"MoveRail"% 0\exact,0; !例行程式帶開關引數測試
%"MoveRail"% 0,0\target:=targettest; !例行程式帶可選引數測試
%"Rob1_Side"+NumToStr(pathnum,0)+"_"+NumToStr(targetnum,0)%; !常見路徑樣式呼叫測試
ENDPROC
PROC MoveRail(num movedistance\switch exact,num transdis\switch Rhome\var num target)
IF Present(exact) THEN
TPWrite"2,exact";
ELSE
IF Present(target) THEN
TPWrite"3,target:="\Num:=target;
ELSE
TPWrite"1,no exact";
ENDIF
ENDIF
ENDPROC
PROC Rob1_Side0_0()
TPWrite"Rob1_Side0_0";
ENDPROC
ENDMODULE