Skip to main content

Read File Data

Instruction Parameters

Supported PLC Series

XPnA/1RXPnBXPnEXPnFCP3A/B/P/U
CP4A~D/U
CPnECPnFBPPLC-S
--
Supported Module

Only the CM1-PS02A module is supported for this instruction.

Supported Data Registers

MXYKLFTCSZRQD@DConstant
n1-
n2-
D------
n3-
n4--------

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1-
CarryF11.2-

Number of Steps

Steps
6

Operands

OperandDescription
n1The first operand.
Entries are Hexadecimal data registers or constants.
This is the offset to read from.
The offset depends on the file being read.
n2The second operand.
Entries are WORD data registers or constants.
This is the offset to read from.
The offset depends on the file being read.
DThe third operand.
Entries are only WORD data registers.
This is where the read file data is stored.
This requires n3 data registers.
n3The fourth operand.
Entries are WORD data registers or constants.
This is the amount of WORD data to read.

The value range is 0 ~ 255.
n4The fifth operand.
Entries are only WORD data registers.
This is the result of the read operation.

Assignment Example

The following example shows how to assign values to n1 and Base/Slot.

n1

Base NumberSlot Number
H0A0B
Hexadecimal2 Digits in Hexadecimal2 Digits in Hexadecimal

Base/Slot (CM1)

Base NumberSlotExample
Local BaseSlot Number 5H0005 or 5
1st ExpansionSlot Number 3H0103
10th ExpansionSlot Number 7H0A07
14th ExpansionSlot Number 12H0E0C
16th ExpansionSlot Number 10H100A
  • If Base Number is assigned to HFF, it means file.
  • If Base Number is assigned to HFF, assign PID of the file at Slot Number.

n4 Format After Execution

Bit NumberDescription
Bit 00: Operation Complete
1: Operating Instruction
Bit 1Operation Error
Bit 2 ~ 7Not used
Bit 8 ~ 15Error Code:
H00: No error
H01: Capacity of 1 scan process is exceeded. Maximum 32 file read operations possible per 1 scan.
H02: D area overflowed.
H03: n3 (offset) assignment error.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.

F11.0 turns ON if access to the expansion module fails.
F11.0 turns ON if the base and slot number assigned to n1 is not an expansion module.
F11.0 turns ON if the offset of the file data assigned to n3 exceeds the range of 0 ~ 255.

Instruction Behavior

The TEST and TESTP instructions behave as follows:

  • The value, S2, is value from 0 ~ 15.
    • If the value, S2, is greater than 15, the remainder of S2 ÷ 16 is the equivalent.
      • Example: if S2 = 17, the remainder is 1. This is the same as S2 = 1.
  • If the BOOL data register, D, is 0, the status of the BOOL data register, D, is OFF.
  • If the BOOL data register, D, is 1, the status of the BOOL data register, D, is ON.

Examples