URGENT siemens S7 question.....

kegman

Member
Join Date
Oct 2003
Location
London
Posts
25
This is the deal. I have 10 menus within a siemens S7/400 plc used for speed control on 1 conveyor. Each menu has a Db ( 201-211 ) Each menu then has its parameters which are the datawords within the datablock.

When a specific menu is chosen via an lauer pcs touch panel, the data block for that menu is loaded into a working datablock 200.

example. joe bloggs selects format number 6 which loads DB206 into DB200 9 working DB )

What i want to do is install a increment and a decrement button to allow me to fine tune the conveyor speed as required. This has to be done frequently due to belt wear ect.....

So, i want to to be able to push a button which will increment the conveyor speed setpoint stored in dataword by say 10 and then transfer it back to the same data word.

I have tried the following but no joy.

A I 69.0 increment button
JC M001
NOP 0

M001 DB200.DBW 86
INC 10
T DB200.DBW 86


Any help much appreciated. PS the values are stored as a "real " number within the DB

Cheers,
Jason
 
I see a couple of problems:

1) the INC instruction is only suitable for values up to 255. You should use a math instruction instead. Thry this

L DB200.DBW 86
+ 1
T DB200.DBW 86

2) You have to make a one shot from your push buttons, because math instructions are unconditonal, and it will execute for as long as you push the button:

A I 69.0
FP M10.0
= M10.1

Then, you can use M10.1 anywhere as a one shot.

You will also have to have a method of clamping min and max values for DBW 86.

I'm assuming that you are going to convert DBW 86 to a real number and then add it to some other value in the PLC. You do the conversion like this:

L DB200.DBW 86
ITD
DTR
etc, etc

Or, to avoid the conversion, you can just use real numbers directly instead:

L db200. DBD 86
L 1.0
+ R
T Db200.DBD 86

That would require you to change your data addresses though, so maybe you don't want to do that.
 
Last edited:
Hello again,
I have installed the one shot which works fine. I am not using the jump conditional as before. code as follows.

A M12.1 one shot
L DB200.dbw 86
+ 1
T DB200.dbw 86

I have used a value of 1, 10 and a hundred. However, the value is only loaded into DBW86 when i save and download.....Not when the one shot is triggered.

The menu value stored in DBW 86 is as follows.
1.2100000e+001 This is the value i wnat to increase / decrease but no joy.

Any more suggestions...... i must be doing something wrong but what it is.....?
 
Go to or create a VAT and view it. I am confused because you are giving a floating point value on a word.
What does it show in a VAT??
 
If you can not change a value in the PLC, it might simply mean that some where, the code "writes" that value and so cancels your changes.
You can check to see if this is the case by trying to change the value manually, say in a VAT. If so, you have to apply your change in a place where it will take precedence over the original code.

Also, pay attention that "reals" in S7 are DD(double data) not DW (data words) variables.

Good luck!!!
 
This will not work, because a math instruction is not conditional:
A M12.1 one shot
L DB200.dbw 86
+ 1
T DB200.dbw 86

DBW 86 is going to increment whether the one shot is true or not. Try this:

A M12.1 one shot
JCN M001
L DB200.dbw 86
+ 1
T DB200.dbw 86
M001: Nop 0

Now, DBW 86 will increment by one every time you push the button.

DBW 86 cannot be a real value, because a real number takes four bytes. It wasn't clear to me what you were doing with DBW 86, and I assumed you were adding it to another Real Number (see my post above), but it looks like you want to use it directly. In that case, you have to use a doubleword. As a test, take a MD that you aren't using (I'll use MD 400), and insert it into the logic, and you'll see what I mean:

A M12.1 one shot
JCN M001
L DB200.dbw 86
+ 1
T DB200.dbw 86
L MD400
L 1.000000e+000 (just type 1.0; S7 will pad the other zeros for you)
+R
T MD400
M001: Nop 0

When you monitor MD400, it will increment by 1.0.
 
If you want a function that works and is done for you, here it is. I created this function to move blocks of data. You can you is it for 1 byte or 4,000 bytes. I have added the pointer you need and to increment it and roll back to the beginning when you reach the last DB. Enjoy! There is also a function that converts ASCII data from a barcode reader to a Double Int.
 
Thanks guys

Just a quick note to say thanks to everyone for their help. The software is now in and working fine. The main problem was that i was calling a DBW and it should have been a DBD.

Regards,
Jason
 

Similar Topics

Hi All Dears... I Have One System With , DI : 16 Do : 16 AI : 8 AO : 8 I Am New In Automation.Also Note That I Am Using Siemens Products.Please...
Replies
8
Views
2,420
We had a siemens TP27 installed on one of our machine, I never worked on this before I dont know how to start. the technician says that all the...
Replies
12
Views
4,576
Good People, I am badly stuck here and seeking urgent help. I am using ET200S system having IM151-8 CPU. The programming software I've got is...
Replies
1
Views
2,355
hello, All LED's on Siemens PLC(CPU 315-2 PN/DP)are blinking continiously & program is not getting downloaded in PLC.i try to format MMC card but...
Replies
10
Views
8,853
My dear Friends our SIEMENS SLC is having CPU315-2DP(processor) and CP341-rs422/485 communication card. I want to see comm.paramenters in CP341...
Replies
5
Views
3,056
Back
Top Bottom