函数没有任何的内部条件,确实是讲当用相同的输入变量时就会得出
相同的结果(输出)。
� Examples for calling up the function described above
Examples for calling up the function described above:
in ST:
Result := Fct(7, 2, 4);
程序(Program)
程序是一种程序结构单元,在运行过程中返回一定数量的值。程序在
整个工程中都能够被识别。
程序能够被调用,但不承诺在函数中调用程序。如果在程序结构单元
中调用程序时程序的返回值有变化,这些变化将保持到下一次程序调用,
即使程序程序是从其它程序结构单元调用的。
程序由起始关键字 PROGRAM 开始,END_PROGRAM 终止。.
� Examples of calls of the program described above
in ST:
PRGExample;
Res := PRGexample.PAR;
If the variable PAR from the program PRGexample is initialized by a main
program with 0, and then one after the other programs are called with above na
med program calls, then the RES result in the programs will have the values 1, 2
, and 3. If one exchanges the sequence of the calls, then the values of the given r
esult parameters also change in a corresponding fashion.
PLC_PRG
PLC_PRG 是一个专门的预先定义的程序结构单元,任何工程都必须
含有那个专门的程序。每次循环的过程中调用一次 PLC_PRG 。
在新工程建立之后第一次执行 "Project" "Object Add" 命令时,程序结
构单元对话框中的初始输入项确实是名为 PLC_PRG 的程序类型。
评论0
最新资源