S7-300 STL CRC calculation

Jirrr

Member
Join Date
Jan 2009
Location
Czech
Posts
167
Hello,I understand that the code bellow add value of bytes together,but why there is XOW istructinon????

OPN DB [#tmp_DB_NO]
L #tmp_LOOP // -> Loopcounter
LOOP: T #tmp_LOOP
L B [AR1,P#0.0] // loading the values in DB
L #tmp_CRC_TEMP
// XOW
+I
T #tmp_CRC_TEMP

+AR1 P#1.0 // increase the addressregister on next byte in field

L #tmp_LOOP //-> doing so often like in amount in Any Pointer is described
LOOP LOOP


Thanks a lot...
 
It is not active in the code you supplied? Or did you add the // ?
 
There are many different methods to calculate a CRC. Two simple ones are to XOR the data together, or to add the data together.

As boneless says, the XOW is commented out, and not active, in your code. It is possible they used to use the XOR method, and switched to addition.
 
I commented it out,because it did not work properly with it....manufacturer sent me a new remade program and it did not communicated with one tester until I did it.....and so I could not find a reason for using XOW...probably it was only mistake....Anyway Thanks a lot
 
Hello,Yes I see it is simply checksum (but FB is named CRC calculation)...
by the way is there any good implementation of CRC for simatics or some good tutorials about CRC?Thaks
 

Similar Topics

First off thank you in advance. Second I am very new to STL. I am trying to build a counter that has one count up and 23 count down options. Am...
Replies
6
Views
377
Hi.Can I convert the block written in stl mode below to ladder mode? L #InOctet SLD 3 L #InBit OW T...
Replies
2
Views
556
Another STL question. In the attached screen shot the line with = #sf.S01_Dryer_ON dose not have the RLO on. But if we look lower in the logic...
Replies
4
Views
1,227
Hello, I am still new to STL. But from what I understand is the JC mnemonic should jump if RLO = 1. If we review both pictures the M0bf RLO = 1...
Replies
5
Views
1,052
Hi, I am useless at STL and not fortunate enough to have SCL. I am trying to do the following; MW1 := 6 MW2 := 400 DB100.DBW[MW1] := MW2 So store...
Replies
3
Views
1,661
Back
Top Bottom