Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 827

Table of Contents

Advertisement

Precaution
• Do not read or write the system word (C2) from any other instruction. DSW(210) will not operate
correctly if the system word is accessed by another instruction. The system word is not initialized by
DSW(210) in the first cycle when program execution starts. If DSW(210) is being used from the first
cycle, clear the system word from the program.
• I/O refreshing must be performed with the I/O Unit connected to the digital switch or thumbwheel
switch after each DSW(210) instruction is executed. If the cycle time is short, operation may not be
correct depending on the ON/OFF response time of the I/O Unit. If necessary, use an I/O Unit with a
short ON/OFF response time or use the minimum cycle time function to adjust the cycle time. Do not
connect the digital switch or thumbwheel switch to the following Units.
• Basic I/O Units or High-density I/O Units mounted in a SYSMAC BUS Remote I/O Slave Rack
• Communications Slaves (DeviceNet or CompoBus/S Slaves)
• DSW(210) reads the 4-digit or 8-digit data once in 16 cycles, and then starts over and reads the data
again in the next 16 cycles.
• When executed, DSW(210) begins reading the switch data from the first of the sixteen cycles,
regardless of the point at which the last instruction was stopped.
• There is no restriction on the number of times that DSW(210) can appear in the program (unlike the
C200HX/HG/HE and CQM1H Series).
Example Programming
In this example, DSW(210) is used to read an 8-digit number from a digital switch and outputs the
resulting value constantly to D0 and D1. The digital switch is connected through CIO 100 (allocated to a
CS1W-ID211 16-point DC Input Unit) and CIO 200 (allocated to a CS1W-OD211 16-point Transistor
Output Unit).
D32000 is used as the system word.
P_On
Always ON Flag
CS/CJ/NSJ Series Instructions Reference Manual (W474)
DSW(210)
100
I
200
O
D
D0
C1
&1
C2
D32000
3. Instructions
3
791

Advertisement

Table of Contents
loading

Table of Contents