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