5 I/O Refreshing
5 - 36
NX-series Digital I/O Unit User’s Manual (W521)
LD
Internal
Variables
Name Data type Default value Comment
State UINT 0 Internal status of program
Error BOOL FALSE Error flag
ErrorCode WORD 16#0000 Error code
InputTimeStamp ULINT 0 Recorded input changed
time
SetOutputTimeStamp ULINT 0 DC time set for the
specified time
OffsetTimeStamp ULINT ULINT#500000000 Time from the input
changed time until the
specified time (ms)
OffsetErrorTaskExeCnt ULINT ULINT#3 Error criteria for specified
time
TaskPeriod ULINT ULINT#1000000 Task period (ms)
TmpWork ULINT --- Workpiece for determining
specified time error
External
Variables
Name
Data
type
Comment
E001_Time_Stamp_of_Synchronous_Output
ULINT
DC time for the timing of synchronous
outputs from the NX Unit
N1_Input_Bit_00_Time_Stamp ULINT
Input changed time for input bit 00
N2_Output_Bit_00
BOOL
Output bit 00
N2_Output_Bit_00_Time_Stamp
ULINT
Specified time for output bit 00
N2_Output_Bit_00_Output_Status
BOOL
Output status for output bit 00
S
InputTimeStamp
<>
EN
In1
In2
State
UINT#0
=
EN
In1
In2
MOVE
EN
In
ENO
Out
InputTimeStamp
EN
In1
In2
OffsetTimeStamp
TmpWork
OffsetErrorTaskExeCnt
TaskPeriod
*
EN
In1
In2
ENO
Out
TmpWork
UINT#0
MOVE
EN
In
ENO
Out
State
ORD#16#
MOVE
EN
In
ENO
Out
ErrorCode
<=
EN
In1
In2
OffsetTimeStamp
TmpWork
>
InputTimeStamp
OffsetTimeStamp
+
EN
In1
In2
ENO
Out
SetOutputTimeStamp
MOVE
EN
In
ENO
Out
S
Error
2_
utput_Bit_0
UINT
MOVE
EN
In
ENO
Out
State
0 State0: Wait for input bit 00 to change.
If the specified time is 3 task periods or less, error end.
Transit to set the specified time and to check the output.
SetOutputTimeStamp
N1_Input_Bit_00_
Time_Stamp
N1_Input_Bit_00_
Time_Stamp
N2_Output_Bit_00_
Time_Stamp