Eeprom S7200

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

1. .

The "EEPROM (v1.0)" folder added contains the subprograms "EEPROM_Direct" and "EEPROM_Indirect".

Fig. 01

Using the subprograms


1. Insert the required subprogram from the "EEPROM (v1.0)" folder into your network.
2. Assign the inputs and outputs of the selected subprogram call Notes on this are in the parameter tables of the
examples.

Using appropriate connection logic to ensure that the trigger for executing the program remains 1 (high) at the "Start"
input for the duration of the execution.

More information is also available in the comments of the subprogram.

Note
Do not store any data with high frequency in the EEPROM. Typically, only 100,000 memory accesses to an EEPROM
are possible. If this value is exceeded, the CPU becomes defective. If you store values on the EEPROM by the hour,
then the EEPROM has an expected service life of 11 to 12 years.
Example of direct addressing of the start address "EEPROM_direct"

Fig. 02

Parameters Variable Explanation


type
EN BOOL Must always be 1 (high)
Start BOOL Trigger for program execution, activated by rising edge (0 ->1); must remain 1 (high) until BUSY
bit becomes 0 (low).
V_Start INT Absolute specification of the start address, e.g. 200=VB 200
Length INT Number of bytes to be stored as from the start address
Memory INT Temporary memory for subprogram
Busy BOOL Processing status 1 (high), program in operation
Done BOOL Finished status 1 (high), storage completed successfully
Table 01
Example of indirect addressing of the start address "EEPROM_indirect"

Fig. 03

Parameters Variable Explanation


type
EN BOOL Must always be 1 (high)
Start BOOL Trigger for program execution, activated by rising edge (0 ->1); must remain 1 (high) until BUSY
bit becomes 0 (low).
Address DWORD Pointer to the first bit of the start address (the start address is read into a variable of the type
DWORD)
Length INT Number of bytes to be stored as from the start address
Memory INT Temporary memory for subprogram
Busy BOOL Processing status 1 (high), program in operation
Done BOOL Finished status 1 (high), storage completed successfully
Table 02
Testing the program
After running the program, delete the retained V variables and load the stored data back into the CPU.

No. Remarks
1 Deleting the data
Navigate via "View > Component > System Block" to the "System Block" dialog and select the "Retentive Ranges"
tab.

Fig. 04
Select the data area and enter the start address and start range. Click on the "Clear" button. Sample values are shown in the
figure below.
Fig. 05
2 Loading the data
 Switch off the CPU.
 Switch on the CPU.
During startup of the CPU, the stored data is written from the CPU's internal EEPROM into the memory.
Table 03
Additional information
 Information on inserting libraries in STEP 7 Micro/WIN is available in Entry ID: 16689345.
 SP7 for STEP 7 Micro/WIN V4.0 is available for downloading free of charge in Entry ID: 33005232 .
Download

store_to_eeprom.zip ( 4 KB )

Keywords:
SMB31, SMW32

You might also like