Input/Output Control Instructions; Or Xw (Contact Input) - Hitachi SJ700-2 Series Instruction Manual

Easy-sequence programming software ezsq
Hide thumbs Also See for SJ700-2 Series:
Table of Contents

Advertisement

5.5 Input/Output Control Instructions

This section describes the details of input/output control instructions.
X ( ) or Xw (contact input)
- Formats
Format
1
<variable>= X (ii)
2
<variable>= Xw
- Explanation
This instruction fetches the status of contact input terminals X (00) to X (07) and stores it in <variable>
in units of bits or words. You cannot 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: 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 creating a user program, consider the on and off states of
actual intelligent input terminals 1 to 8.
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 programs
Sample 1:
Program to invert the status data of input terminal X (01) and output it to output terminal Y (05)
entry
LOOP
UB(00)=
ifs
then
Y(05)=
else
Y(05)=
end if
goto
end
Sample 2:
Program to acquire input terminal status as word data and output only the status of terminals X (02) to X
(05) as word data to output terminals Y (00) to Y (03)
entry
LOOP
U(00)=
U(00)=
U(00)=
Yw=
goto
end
Instruction to access contact inputs
This instruction assigns the ii'th bit of contact input data to <variable>.
(ii = 00 to 07)
This instruction assigns contact input data as word data to <variable>.
X(01)
UB(00)
=
0
1
0
LOOP
Xw
U(00)
/
4
U(00)
and
15
U(00)
LOOP
Chapter 5 Instruction Words
Description
: 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.
: Fetch input terminal status and store it in the user
variable.
: Cut off the data of X (00) to X (01).
: Mask the data of X (06) to X (07).
: Output the data of X (02) to X (05) as word data.
5 - 15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sj700 series

Table of Contents