FWRITE

FWRITE

 

FWRITE instruction copies a specified device data of CPU module to the system memory of special module.

(It supports only in CM1-PS02A special module)

 

n1

Slot number of special module

n2

Starting system memory to be written

D

Starting device address to copy

n3

Number of system memory to copy

n4

Result of operation

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

FWRITE

n1

o

o

o

o

o

o

o

o

-

o

o

o

o

6

o

-

-

n2

o

o

o

o

o

o

o

o

-

o

o

o

o

D

o

-

o

o

o

-

-

-

-

o

o

o

-

n3

o

o

o

o

o

o

o

o

-

o

o

o

o

n4

o

-

o

o

o

-

-

-

-

o

o

o

-

 

When enabled, the FWRITE copies specified device address (n3 of D) from the CPU module to the system memory (n2) of special module that is installed in n1 and saves the result of instruction operation in the n4.

 

 

  • n1 : HEX that shows Base and Slot number of special module.

Ex) H + (Base number) + (Slot number)

Base number

Slot number

n1

Local Base

Slot number 5.

H0005

Expansion Base number 1.

Slot number 3.

H0103

Expansion Base number 10.

Slot number 7.

H0A07

Expansion Base number 14.

Slot number 12.

H0E0C

Expansion Base number 16.

Slot number 10.

H100A

  • Please refer to below the Base and Slot number system for CM1 series.

 

  • n2 : Offset that is starting address of system memory to be written.

(Please refer to System memory of positioning module)

  • n3 : Size (number of system memory to write)

The range of n3 is from 0 to 32,767.

If n3 is 0, instruction will not work and if n3 is out of range, it occurs an error.

  • n4 : the result of instruction operation is stored in n4.

Bit No.

Description

0

If instruction is running (1), If instruction is completed (0)

1

Error

2 – 7

Not used

8 - 15

Error Code

00H : No error

01H : Maximum 32 data can be read and write at the same time for a scan

02H : Data size is out of range

03H : Wrong Offset

 

  • The error flag is turned ON if :

a. CPU cannot access expansion module.

b. n1 is not special module (CM1-PS02A)

c. n3 exceeds Destination.

d. n3 is out of range (0 – 32,767)

 

Base and Slot number for CM1

 

 

 

Example)

If M00 is ON, the FWRITE instruction copies 20words of D20 (from D20 to D39) and saves to the system memory 28 (from 28 to 47) of positioning module that is installed at slot no. 3 in the local base. The result of operation is stored in M00.