Whole db Crc check ?

SHKODRAN

Member
Join Date
May 2010
Location
Italy
Posts
102
Can anyone tell me how to monitor a db if the data changes?
I want to restore data from the store db to destination db only if the information does not match the source to the destination..
Can someone help me.
Note: Db is 100 byte only Dword data!
Thanks.
 
@ L D[AR2,P#0.0]
You're right, I can do a comparison of the two db, the problem is that I can not
do it cyclically.
Theoretically no one could write of db, since it is protected by dynamic password (HMI), but often the technicians provide the formula of password generation , then they also operators.

@TurpoUrpo
No , it is not a barrier , I understand you , but it is db of important machine parameters.

Thank you, and sorry for my English disastrous.
 
Can anyone tell me how to monitor a db if the data changes?
I want to restore data from the store db to destination db only if the information does not match the source to the destination..
Can someone help me.
Note: Db is 100 byte only Dword data!
Thanks.

Add up the byte (or word) values to a double word containg the check sum. Compare with the check sum for the protected DB.
It is not 100% secure if more values are changed at the same instant, and the sum of the changes = 0.

Kalle
 
Here's the source to compare two DB's and correct one to the other and indicate when they are different:

Code:
FUNCTION FC 5 : BOOL
TITLE =if userDB <> MasterDB then userDB:=MasterDB
VERSION : 0.1

VAR_INPUT
  MasterDB : BLOCK_DB ; 
  UserDB : BLOCK_DB ; 
END_VAR
VAR_TEMP
  iloopCount : INT ; 
END_VAR
BEGIN
NETWORK
TITLE =RET_VAL := userDB <> MasterDB 
      SET   ; 
      R     #RET_VAL; 
      LAR1  P#DBX 0.0; 
      LAR2  P#DIX 0.0; 
      OPN   #MasterDB; 
      CDB   ; 
      OPN   #UserDB; 
      L     DBLG; 
A:    T     #iloopCount; 
      L     B [AR1,P#0.0]; 
      L     B [AR2,P#0.0]; 
      ==I   ; 
      JC    ok; 
      S     #RET_VAL; 
      T     B [AR1,P#0.0]; 
ok:   +AR1  P#1.0; 
      +AR2  P#1.0; 
      L     #iloopCount; 
      LOOP  A; 
      SET   ; 
      SAVE  ; 
END_FUNCTION
 
Not bad the idea of ​​LD [AR2, P # 0.0], I thought of doing something univesrsale for use with the Db-linked and unlinked, but it's better than nothing.
I will try to implement something more, thanks for the help
you are very helpful.
 

Similar Topics

Hi, I have an issue with an S7 PLC when downloading over WiFi. It's a pretty big FB that I wanna download and the connection is poor. But it's...
Replies
6
Views
2,329
Hi, all. I seemed to have hit a wall on my decimal to fraction forum. Therefore, anyone know how to separate a number like 17.33333 into 17 and...
Replies
9
Views
3,972
Hey guys, I have a customer who wants to install a plant process network. Of course this is a large project and its barely in the development...
Replies
3
Views
2,302
Hi, Does anyone know how to do this on an S5 115U PLC? It doesn't seem as straight forward as S7. For example, I want to move DB1 with 255...
Replies
4
Views
1,306
Hi, I only know how to read one bit of e.g. an input port, using e.g. I0.7 or names from the standard table for such a single IO line. Is there...
Replies
11
Views
4,580
Back
Top Bottom