P13_EPWT EEPROM write to memory

Using this instruction data will be copied from the data area (DT) to the EEPROM/ Flash-ROM.

Parameters

Input

EN (BOOL)

Activation of the function (when EN changes from FALSE to TRUE, the function will be executed one time)

s1_Start (WORD, INT, UINT)

DT start address of the block(s) that you want to save

s2_Number (DWORD, DINT, UDINT, DATE, TOD, DT)

Number of blocks to be written. The block size is 64 or 2048 data registers depending on the PLC type (see the following table "PLC specific information").

d_Start (DWORD, DINT, UDINT, DATE, TOD, DT)

EEPROM start block number

Output

ENO (BOOL)

When the function was executed, ENO is set to TRUE. Helpful at cascading functions with EN-functionality

Remarks

The EEPROM memory is not the same as the hold area. The hold area stores data in real time. Whenever the power shuts down, the hold data is stored in the EEPROM memory. The P13_EPWT instruction sends data into the EEPROM only when the instruction is executed. It also has a limitation of the number of times you can write to it (see table below). You must make sure that the P13_EPWT instruction will not be executed more often than the specified number of writes.

For example, if you execute P13_EPWT with R901A flag (pulse time 0.1s), the EEPROM will become inoperable after 100,000 * 0.1 sec=10,000 sec (2.8 hours). However if you want to hold your profile data such as positioning parameters or any other parameter values that are changed infrequently, you will find this instruction very useful.

NOTE

One of the two input variables s2_Number or d_Start has to be assigned constant number value.

PLC specific information

PLC type

FP0 2,7k C10/C14/C1, FP-e

FP0 5k C32

FP0 10k T32CP

FP-Sigma, FP-X, FP0R

FP0H

ROM

EEPROM

EEPROM

EEPROM

Flash-ROM

Flash-ROM

Block size (1 block)

64 words (64x16bit)

64 words (64x16bit)

64 words (64x16bit)

2048 words (2048x16bit)

2048 words (2048x16bit)

EEPROM start block number

0 to 9

0 to 95

0 to 255

0 to 15

0 to 31

Number of blocks to be read / written each execution

1 to 2

1 to 8

1 to 255

1 (writing)

1 to 16 (reading)

1 (writing)

1 to 32 (reading)

Write duration (additional scan time)

< 20 ms each block

< 5 ms each block

< 5 ms each block

< 100ms each block

< 100ms each block

Read duration (additional scan time)

Less than 1 ms each block

Less than 1 ms each block

Less than 1 ms each block

9.94ms + (1562.6*number of blocks) ms

 

Max number of writing events

100,000

10,000

10,000

10,000

10,000

Max read times

No limit

No limit

No limit

No limit

No limit

NOTE

Power down, RUN -> PROG mode changes are also counted.

Example

POU header

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

	VAR
		start: BOOL:=FALSE;
		@'data field': @'ARRAY (0..63] OF INT':=@'(1,2,3,4,5,6,7,8,9,10,11,12,52(0)]';
	END_VAR

POU body

When the variable start changes from FALSE to TRUE, the function is carried out.

The function reads the contents of data field[0] until data field[63] (s2* = 1 => 1 block = 64 words) and writes the information after start block number 0 into the EEPROM.

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 6 ;
        NETWORK_BODY
B(B_F,P13_EPWT!,Instance,11,0,19,6,,?DEN?Ds1_Start?Ds2_Number?Dd_Start?AENO);
B(B_VARIN,,DataField[0],9,2,11,4,);
B(B_VARIN,,1,9,3,11,5,);
B(B_VARIN,,0,9,4,11,6,);
B(B_CONTACT,,start,3,1,5,3,);
L(1,2,3,2);
L(5,2,11,2);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

IL body

Modified on: 2020-04-09Feedback on this pagePanasonic hotline