Siemens S7/TIA v16: Don't quite understand the M-bit naming convention...

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
I'm from a Mitsubishi Q-series background so excuse my ignorance. In Mitsubishi world, in my experience your Mbits (booleans) are just M1, M2, etc, but in S7 they're M0.0, M0.1 (see picture). Can you have any number of M0.x bits or is there an upper limit before you move on to M1.0, M1.1, etc? Thanks

IMG_20230614_101059.jpg
 
Upper limit usually depends on the spec of the CPU. The M memory area can be confusing as M0.0 is in the same space as MB0(byte), MW0(word), MD0(double word). Suggest you use data blocks instead.
 
The M bits are grouped into bytes so you will get M0.0 to M0.7 before you move on to M1.0 to M1.7 etc.
 
Merkers, S5-Timers and S5-Counters in S7-1200/1500 are mostly included for backwards compatibility with older S5 and S7-300/400 programs.

I only use these for quick-and-dirty program changes on the fly, and I don't want to change DBs on a running system.
 
I generally avoid using the M0 and M1 addresses as these are the defaults for the system and clock bits if you decide you need those later.

Also I found out when I first started with Siemens that it doesn't care if you overlap on your assignments, so if you have a series of bits on M10.0 to M10.7, but then you assign a value to MW10 it will cheerfully compile and your program will sit there firing seemingly random bits.
 
In the old S5 "M" was the german designation "MERKER" & "F" "FLAG" in english, I & Q in english is E & A for german language Ein / Aus PIW & PQW is direct access to the I/O in word format.
As siemens is 8 bit addressing like Mitsi, (mitsi has also 16 bit addressing i.e. X0 - XF however, as mitsi goes 0-7 then 10-17 & so on Siemens uses 0.0 - 0.7 & 1.0 to 1.7 & so on.
 
In the old S5 "M" was the german designation "MERKER" & "F" "FLAG" in english, I & Q in english is E & A for german language Ein / Aus PIW & PQW is direct access to the I/O in word format.
As siemens is 8 bit addressing like Mitsi, (mitsi has also 16 bit addressing i.e. X0 - XF however, as mitsi goes 0-7 then 10-17 & so on Siemens uses 0.0 - 0.7 & 1.0 to 1.7 & so on.

Hi parky, good to see you around again. Thanks for this.
Doing some S7/TIA at the moment, hence all these basic questions.
Cheers
 
Not sure about S7 TIA as I generally use nearly all DB words/bits, on the Older S5 M bits were none retentive, perhaps you can now define a range to make them retentive, Years ago I would copy them to a DB at the end of scan then on a re-start copy them back.
On S7 you can define some M Bits for things like clock/ diagnostics etc. so as quoted earlier by a poster they are not all reserved. again in the older S5 MW200 to 255 were effectively reserved by Siemens own function blocks as temporary memory areas, they could be used in your own code but only as temps as they could be overwritten if some siemens own FB's were used.
DB Memory in S7 is not fixed, only DB's that you create (or possibly created as part of the S7 system) are actually stored in the memory so effectively the DB memory area is only as big as you make it. "M" memory is fixed so always available. Just remember when using DB's make sure that any DB/Word i.e. DB10.DBW20 exists if you only configure a DB for 10 words then accessing any words above this will shut the PLC down.
 
I also mostly organise my tags in DB's rather than M bits. I find it easier than to navigate than the tag tables and you can make the tags retentive (just checked, M bits are not retentive).
To my knowledge the only thing writing to M bits should be your own code in S7.
 
I also mostly organise my tags in DB's rather than M bits. I find it easier than to navigate than the tag tables and you can make the tags retentive (just checked, M bits are not retentive).
To my knowledge the only thing writing to M bits should be your own code in S7.

When you say DB, are you talking about data blocks? In Mitsubishi parlance D-registers, I think...but if you've not done Mitsubishi that won't mean owt to you.

EDIT: Cancel that question...just seen video online about it. Thanks
 
Last edited:

Similar Topics

In OB1, I'm monitoring some values (first pic). The values are what I expect. At the same time, I'm monitoring the same values in the DB where...
Replies
1
Views
651
Siemens S7/TIA v16: "Overwrite if object exists online?" HMI loading message... Thus far, I've just been ticking this box, just to get the HMI...
Replies
4
Views
769
I'm having a bad day. Daft question coming up...Anyone know why I can't add anything into this DB? Add button is greyed-out. Thanks
Replies
14
Views
1,597
I imported a customised shape into the project, but I don't know how to actually add into on to a specific HMI screen. Do I use the Graphics menu...
Replies
2
Views
661
Hi I'm trying to display a value on the HMI. In monitor mode on the code, I can see that value, but on the HMI , after downloading, it is...
Replies
10
Views
947
Back
Top Bottom