View Full Version : S5 code to write to DB data
Combo
May 19th, 2010, 07:27 AM
Hi,
As an S7 programmer I do miss some S5 knowledge. Especially in german.
13739
I need to write value 50 or 150 to DB101 var 11. As you can see the value is now 50, I guess that this can be overwritten with S5 code ?
This is what I want to write:
U E6.0
JCN =NEXT
A DB101
L 75
T DW 11
JU =END
NEXT:
A DB101
L 150
T DW 11
END:
But offcourse, some instructions are faulty. Can anyone help with this ? Thanks.
Kind Regards,
Gerry
Jeebs
May 19th, 2010, 07:54 AM
U E6.0
JCN =NEXT
A DB101
L KF +75
T DW 11
JU =END
NEXT: Something missing here. Either NOP 0 or you start directly with A DB101
A DB101
L KF +150
T DW 11
END: If this is the end of the block, then in stead of JU =END, use BEU. If you use JU, then you need to add NOP 0
Sure you can't change to English?
Combo
May 19th, 2010, 08:14 AM
I'm not sure, but I think I have installed S5 für Windows (german).
Found some code that illustrated a jump (SPB)
I think this will be better, but I'm not sure (BEU = BEB in german I think):
;A DB101
U E6.0
SPB =M001
L KF +75
T DW 11
BEB
M001:
L KF +150
T DW 11
BE
Jeebs
May 19th, 2010, 08:22 AM
:A DB101
:
:U E6.0
:SPB =M001
:L KF +75
:T DW 11
:BEA
M001:L KF +150
:T DW 11
:BE
That should work.
Combo
May 19th, 2010, 08:24 AM
Thanks Jeebs !!
:A DB101
:
:U E6.0
:SPB =M001
:L KF +75
:T DW 11
:BEA
M001:L KF +150
:T DW 11
:BE
That should work.
Combo
May 20th, 2010, 01:21 PM
I know that DB101 DW11 is a parameter that influences a PID speed. But I wanna know if it's the I parameter. I tried to upload OB251 (where the PID is written), but I couldn't. Should the CPU be in stop to upload this special block ?
Regards,
Gerry
Thanks Jeebs !!
L D[AR2,P#0.0]
May 20th, 2010, 04:09 PM
Which CPU are you using ? OB251 is usually an in-built function.
Combo
May 20th, 2010, 04:25 PM
And what does that mean ?
There must be some PID blocks in the program, but I cannot find them. OB251 is the only block that I can't upload, that's why I think the PID is processed in there ... ?
Don't know S5 very well..
;375421']Which CPU are you using ? OB251 is usually an in-built function.
moggie
May 21st, 2010, 12:56 PM
OB251 is the PID Algorithm OB for S5-95U.
Look here -
http://support.automation.siemens.com/WW/view/en/1091648
FARIAM
May 21st, 2010, 02:38 PM
Combo,
In the page 250 of the Manual moggie posted you will find the info about the OB251, which is the PID Control block for the S595U.
You can't upload the block, you just call it cyclically to make it work.
DW11 is the control word for the PID. Before calling the OB251, what you have to do is open (OPN in english, AUF in german) the DB you want as the parameter DB and change the corresponding values, based on the Table of the page 254.
Regards.
.