8 Application Instructions API 100-149 API 109 Operands: D : Device for storing the read value Explanations: 1. See the specifications of each model for their range of use. 2. Flags: M1104 ~ M1111 (status of digital switch) 3. This instruction stores the value read from digital switch function card into D . 4. The read value is stored in the low byte in D. Every switch has a corresponding bit. 5. When there is no digital function card inserted, the error message C400 (hex) will appear in grammar check. Program Example: 1. There are l 8 DIP switches on the digital switch function card. After the switches are read by SWRD instruction, the status of each switch will correspond to M0 ~ M7.
M1000 M0 Y0 M1 M2 M3 M4 2. The status of M0 ~ M7 can be executed by each contact instruction. 3. The execution of END instruction indicates that the process of input is completed. REF (I/O refresh) instruction will be invalid. 4. When SWRD instruction uses the data in digital switch function card, it can read minimum 4 bits (K1Y*, K1M* or K1S*). Remarks: When digital switch function card is inserted, the status of the 8 DIP switches will correspond to M1104 ~ M1111. DVP-PLC Application Manual 8-20 Mnemonic Operands Function SWRD P Read Digital Switch Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F SWRD, SWRDP:
3 steps D * * * * * * * * PULSE 16-bit 32-bit EH3 EH3 ES EX SS SA SX SC EH SV EH3 SV2 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SWRD K2M0 MOV K2M0 D0 CNT C0 K10 RST C0 TMR T0 K100