6 Programming
6-104
NJ-series CPU Unit Software User’s Manual (W501)
• You can omit the input variable names and input parameter names. If they are omitted, the input
variables are assigned their initial values.
• You can omit EN as well. If it is omitted, EN is assigned a value of TRUE.
Notation Method 2:
Omit the variable names of the called function and give the parameter names of the calling POU.
IF (x0=TRUE) THEN
y1 := MyFUN(x1, x2, y2);
END_IF;
• Ladder Diagram Expression
MyFUN: Function name
x0: Specifies whether to call the function.
A and B: Input variable names of the called function
x1 and x2: Input parameters of the called function
C: Output variable name of the called function
y1: Storage location for the return value from the called function
y2: Output parameters of the called function
• The order of parameters is based on the function definition. The order is the same as the local
variable definition for the function, from top to bottom.
Example:
• Programming
Notation 1
ConvData32ToDouble(Data32_1:=FixPointData1,Data32_2:=FixPointData2,
NoOfDigit_1:=FixPointPos1, NoOfDigit_2:=FixPointPos2,
Double_1=>RealData1, Double_2=>RealData2);
Notation 2
ConvData32ToDouble(FixPointData1, FixPointData2, FixPointPos1, FixPointPos2,
RealData1, RealData2);
• Ladder Diagram Expression
MyFUN
BC
A
EN ENO
x2
x1
y2
y1
x0
ConvData32ToDouble
Data32_1
Data32_2
NoOfDigit_1
NoOfDigit_2
EN
Double_1
Double_2
RealData1
RealData2
FixPointData1
FixPointData2
FixPointPos1
FixPointPos2
P_On