Input/Output Control Instructions; Or Xw (Contact Input) - Hitachi NT2021XA Instruction Manual

Easy-sequence programming software
Table of Contents

Advertisement

Chapter 2 Syntax
2.4

Input/Output Control Instructions

This section describes the details of input/output control instructions.
X ( ) or Xw (contact input)
- Format
Format
1
<variable>
(SJ700 : ii = 00 to 07)
(WJ200 : ii = 00 to 09)
2
<variable>= Xw
- Explanation
This instruction fetches the status of contact input terminals X (ii) and stores it in
write data to <variable>, which is read-only. Details of the formats are explained below.
Format 1 : With this format, the instruction assigns the status of the ii'th bit of contact input data to <variable>. (0 = off, 1 = on)
(Examples)
When terminal X (00) is off: UB= X (00) (UB (00) = 0)
When terminal X (00) is on: UB= X (01) (UB (00) = 1)
Format 2 : With this format, the instruction assigns the status of contact input data as word data to <variable>. (0 = off, 1 = on)
(Examples)
When terminals X (00) to X (03) are on and terminals X (04) to X (07) are off: Uw= Xw (Uw = 15)
When terminals X (00) to X (02) are off and terminals X (03) to X (07) are on: Uw= Xw (Uw = 248)
Note 1 : In the SJ700/L700/SJ700B Series, the setting of terminal active state (C011 to C018) is reflected in the
polarity (on or off) of contact inputs X (00) to X (07) and Xw. When you create a user program, consider the
on and off states of actual intelligent input terminals 1 to 8.
In the WJ200 Series, the setting of terminal active state (C011 to C017) is reflected in the polarity (on or off)
of contact inputs X (00) to X (06) and Xw. When you create a user program, consider the on and off states of
actual intelligent input terminals 1 to 7.
Note 2 : Since this instruction reads the internal input terminal data at least twice (in two execution cycles), storing
the read data in <variable> is delayed by at least two execution cycles.
Note 3 : Wiring noise or switch chattering may cause incorrect read data to be set in <variable>. To avoid such
problems, design your program so that it will verify the read data.
- Sample program
Sample 1 : Program to invert the status data of input terminal X (01) and output it to output terminal Y (05)
Label
Mnemonic
entry
LOOP
UB(00)=
ifs
then
Y(05)=
else
Y(05)=
end if
goto
end
Instruction to access contact inputs
= X (ii)
This instruction assigns the ii'th bit of contact input data to <variable>.
This instruction assigns contact input data as word data to <variable>.
parameter1
parameter2
UB(00)
=
1
0
LOOP
Description
<variable>
parameter3
parameter4
parameter5
X(01)
0
2-18
in units of bits or words. You cannot
: Fetch the status of X (01) and store it as
internal user contact data.
: Branch according to the conditional
expression.
: Turn Y (05) on when the condition is met.
: Turn Y (05) off when the condition is not
met.

Advertisement

Table of Contents
loading

Table of Contents