Newbie with S7 300

rocket1010

Member
Join Date
Jan 2005
Location
Canada
Posts
66
Guys please explain this to me, can't seem to find any SIEMENS literature to disprove or support what I am seeing. I am using the timer below.

timer.jpg

As I am new ot this stuff I am just playing around, I put the time value in MW1, when I look at a variable table and mointor MW1 and MW2, I see the value decrementing in MW1, but MW2 is also counting...something! All the literature I have read indicates Timers only occupy 1 word, whats going on here?

var.jpg
 
My guess:


thats right,
1 word = 2 bytes

mw1= two bytes: mb1 and mb 2
mw2= two bytes: mb 2 and mb 3

so when you put the time into mw1, you put the values into mb1 and mb2, and since mb2 is the part of the mw2, you see what you see.
 
check out this example from plcsim
'right' byte of the mw1 = 'left' byte of the mw2, because it's the same byte - mb2
1321.JPG



It's so in S7.

MwX = MbX and Mb(x+1)



mw2 would be mb3 and mb4 in some other software like CoDeSys for example
 
and I believe there is a same story with double words: md4 would be mw4 + mw6, i.e. mb4+mb5+mb6+mb7
 
When identifying a memory address in S7 there are three things to take in to account -

A) The first letter (or first two letters) tell you where the memory address is located : M, I, Q, DB

B) The final letter indicates how much memory is being addressed on this occasion: B, W, D for byte, word or double-word (i.e. 1, 2 or 4 bytes in length)

C) The number specifies the starting byte address of the data.

Example 1 : DBD24 is in a data block, it's a double-word length address, and it starts at byte 24. This means it uses bytes 24, 25, 26 and 27.

Example 2 : MW1 is in marker memory, is one word long and starts at byte 1. Therefore it uses bytes 1 and 2

Beware overlapping addresses -
MB49, MW48 and MD46 will all affect the same byte number 49

Regards

Ken
 
Thanks so much for all your help, its as clear as mud now! LOL Just kidding, I understand now but this very different than many other PLC's, when in Rome...

Thanks Again
 

Similar Topics

Hi - I am unfamiliar with Siemens PLCs but have been given ownership of an S7-300 CPU318-2 with IO and a network interface card at site. The PLC...
Replies
18
Views
4,272
hello everyone, i m trying to rebuild an old machine sitting idle for many years. it has a OP27 panel and 2 CPUs (314 and 316). i did connect the...
Replies
1
Views
2,269
First time using Siemens... From what I understand, all analog IO raw data is stored on the PLC as 16-bit words. I am configuring 4-20mA...
Replies
10
Views
25,417
Hello All, I inherited a S7 300 project at work after the previous guy left. I'm completely new to PLCs but have been trying to ramp up for a...
Replies
13
Views
5,859
I have a CPU 313C here that I was trying to troubleshoot my program. I am still new to Simatic manager. Anyways, I am monitoring the program and I...
Replies
16
Views
5,221
Back
Top Bottom