6-105
6 Programming
NJ-series CPU Unit Software User’s Manual (W501)
6-5 Programming Languages
6
6-5-3 Structured Text Language
• Function Definition
Function name: ConvData32ToDouble
Function Variables
• Program Variables
Application:
This statement calls a function.
Omitting Parameters
When you call a function, you can omit parameters that are not required. The following table shows
when you can omit parameters.
OK: Possible (initial used), ---: A building error will occur.
I/O Variable name Data type
Input variables Execute BOOL
Data32_1 DINT
Data32_2 DINT
NoOfDigit_1 INT
NoOfDigit_2 INT
Output variables Double_1 LREAL
Double_2 LREAL
Return value --- BOOL
Variable name Data type Comment
ChangeFixToFloat ConvData32ToDouble Convert from fixed-point to
floating-point.
Exe BOOL Execution trigger
FixPointData1 DINT Decimal point position specifi-
cation data 1
FixPointPos1 INT Number of digits below deci-
mal point 1
FixPointData2 DINT Decimal point position specifi-
cation data 2
FixPointPos2 INT Number of digits below deci-
mal point 2
Done BOOL Normal end
RealData LREAL Floating-point data 1
RealData LREAL Floating-point data 2
POU type
Variables for
the called
POU
Notation pattern
Omis-
sion
Parameters included Example
FUN Given (notation
method 1)
All parameters given FUN(x:=a,y:=b,z:=c); OK
More than one parameter given FUN(x:=a,y:=b);
One parameter given FUN(y:=b);
No parameters given FUN(x:=); ---
Given (notation
method 2)
All parameters given FUN(a,b,c) OK
No parameters given FUN();
Only the first parameter given FUN(a); ---
One parameter given FUN(a, , );
More than one parameter given FUN(a,b);