S7 1200, Memory Values acting wierd

rQx

Lifetime Supporting Member
Join Date
Oct 2010
Location
Trelleborg
Posts
1,051
Hi!

I've got a counter with the memory MW1 on the preset value.
I have it in my HMI, I can change it and all works fine.
Until I press a button in my HMI. The only thing the button do is setBit M1.2.
I press it and my MW1 changes to 1024.
I press another button witch is setBit M1.1 and my MW1 changes to 513? :S

This is the only thing the HMI buttons do, and they are not linked to each other in the PLC program. Someone know what the hell is going on here? :p
 
Simple address conflict...

Change your setbit to one you aren't already using
M3.x

MW1 is occupying bits 0 thru 7 in MB1 and 0 thru 7 in MB2 (since it is a word)

bit, byte (8 bits), word (2 bytes)
 
Rather than use any M memory for non bit variables, create a database and then use DB memory. That way you avoid conflicts.

Bryan
 
This is where I lack skill. In memory programming. How do I create a database and this you are talking about?
 
From your block view in manager, right click and create a Data Block

Open the newly created DB and type out your desired locations. Note that you can set the data type in there as well

Addressing it is easy, for your counter val, type out the DB name, use a period and then the name you declared in the DB

For instance, WorkDB.CountPreset would take the place of MW1

Haven't played much with the new TIA 1200 software so this may be a little different

Hope this helps
 
ELake20 has got it right. In TIA, on the left hand side of the screen I have a tree that I can expand to show the components of the current program. From there, inside 'Program Blocks' is 'Add new block', double click it and choose Data Block from the list. For simplicity here make it a Global DB. Double Click the new DB from the tree on the left and enter a name for the value, then the value type and make it Retaining. After that I am not certain how you will go because I always use non symbolic addressing so for me to access the data I would use something like DB1.DBD0. I use non symbolic because of the HMI that I am working with. From ELake20 information you will use DataBaseName.DataName, where DataBaseName is the name you gave to the database and DataName is the name you gave to the Data.

Bryan
 
Thanks alot for further explanation. I think I know how I will do it now, if not so, I will come back!

Thanks
 

Similar Topics

I have a product that uses a Siemens Simatic s7-1200 PLC. My company did not write the PLC program, but we have the program on an SD card. We...
Replies
5
Views
2,262
What type of internal memory does the MicroLogix 1200 Ver.C have? In the documentation, there is only an internal non-removable battery for the...
Replies
1
Views
1,590
Hi Guys, Is there any way of compressing the "Work Memory" of a Siemens S7 1200 CPU. I did change the installed card from a 4mb to a 12mb. I...
Replies
16
Views
9,073
Hello! I am using S7-1200 PLC 1212C AC/DC with configured Modbus TCP Server. I can already read/write Inputs/Outputs (Coils) and Memory Words...
Replies
7
Views
3,031
Hi we currently have a Micrologic 1200 running an automated saw program. If I plug in a memory module will it automatically write the program to...
Replies
1
Views
1,290
Back
Top Bottom