2-585
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Time and Time of Day Instructions
2
NanoSecToTime
NanoSecToTime
The NanoSecToTime instruction converts nanoseconds to a time.
* −9223372036854775808 to 9223372036854775807
The NanoSecToTime instruction converts the number of nanoseconds in In to a time.
The following example is for when In is LINT#90061000000000.
[
Use the TimeToNanoSec instruction (page 2-583) to convert a time to nanoseconds.
Instruction Name FB/FUN Graphic expression ST expression
NanoSecToTime Convert Nanosec-
onds to Time
FUN Out:=NanoSecToTime(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Nanosec-
onds
Input Nanoseconds * ns 0
Out Time Output Time Depends on data type. ns ---
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
(@)NanoSecToTime
EN ENO
In Out
abc:=NanoSecToTime(LINT#90061000000000);
LINT#90061000000000
LD
ST
abc
NanoSecToTime
EN ENO
In
LINT#90061000000000
ns
T#1d1h1m1s
Out=abc
In
Time