2 Instruction Descriptions
2-582
NJ-series Instructions Reference Manual (W502)
SecToTod
The SecToTod instruction converts the number of seconds from 00:00:00 to a time of day.
* Negative numbers are excluded.
The SecToTod instruction converts the number of seconds from 00:00:00 in In to a time of day. If the
value of In is 24 hours or longer, In is divided by 24 and the remainder is converted to the time of day.
The following example is for when In is LINT#86410.
[
Use the TodToSec instruction (page 2-577) to convert a time of day to the number of seconds from
00:00:00 on January 1,1970.
Instruction Name FB/FUN Graphic expression ST expression
SecToTod Convert Seconds to
Time of Day
FUN Out:=SecToTod(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Seconds Input Number of seconds from
00:00:00
Depends on data type.* Seconds 0
Out Time of day Output Time of day Depends on data type. Hour, min-
utes, seconds
---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK
Out OK
Function
Additional Information
(@)SecToTod
EN ENO
In Out
abc:=SecToTod(LINT#86410);
LINT#86410
LD ST
abc
SecToTod
EN ENO
In
Out=abc
In
Remainder of division by 24
TOD#0:0:10.000000000
LINT#86410
TOD#00:00:00
s