2 Instruction Descriptions
2-590
NJ-series Instructions Reference Manual (W502)
This sample gets the number of days in the current month.
Sample Programming
Always TRUE Flag
Variable
Data type
Initial value
Date and time
Days in current month
Comment
LD
abc
def
(Year:=0, Month:=0, Day:=0, Hour:=0, Min:=0, Sec:=0, NSec:=0)
0
_sDT
USINT
abc
def
abc.Year
abc.Month
_CurrentTime
GetDaysOfMonth
EN ENO
Year
Month
DtToDateStruct
P_On
EN ENO
In
DateStruct
_CurrentTime DATE_AND_TIME
Constant
System Time of Day
Variable Data type Comment
Internal
Variables
External
Variables
Variable
Data type
Initial value
Date and time
Days in current month
Comment
ST
DtToDateStruct(_CurrentTime, abc);
def:=GetDaysOfMonth(abc.Year, abc.Month);
abc
def
(Year:=0, Month:=0, Day:=0, Hour:=0, Min:=0, Sec:=0, NSec:=0)
0
_sDT
USINT
_CurrentTime
DATE_AND_TIME
Constant
Variable Data type Comment
System Time of Day
Internal
Variables
External
Variables