Byte numbers in DB (Simatic S7)

apetkov5

Member
Join Date
Aug 2007
Location
x
Posts
101
Greetings!

I made ordinary DB (data block) and inserted data. Every data have own Adress (+0.0, +4.0, +8.0,...), structure (bool, integer,...) and initial value.... Of course that DB have its own number (DB23)...

Now in must do a "put" from that DB to DB on other CPU (by profibus)... The problem is when I specify source (and target) data areas.

They must be in format "P# DB23.DBXyy.0 BYTE zz" (thanx JesperMP)....... so if i nead just data from +4.0 adress can I wrote in "yy" "4" (P# DB23.DBX4.0 BYTE zz) ??

"zz" in syntax means " number of bytes to transfer.....
Can i wrote 1 instead of "zz" when i nead to transfer just bool from 4.0 and "2" if i nead to transfer bool-s form 4.0 and 8.0 ??

What if i nead to transfer bool form 4.0, real from 8.0 and int from 12.0 ?

Please can you describe me principe of that data areas.

btw. plc is siemens
s300
simatic step 7

Thanx a lot!
 
Generally every data type has its lenght, int - 2 bytes, real 4.
So when you transfer it alone, in place of zz put this number.
However you can transfer whole structure, then in place of zz put size of it.
 
so if i nead just data from +4.0 adress can I wrote in "yy" "4" (P# DB23.DBX4.0 BYTE zz) ??
Yes.

"zz" in syntax means " number of bytes to transfer.....
Can i wrote 1 instead of "zz" when i nead to transfer just bool from 4.0
Yes. But you can only transfer complete bytes, not a single BOOL.

and "2" if i nead to transfer bool-s form 4.0 and 8.0 ??
4.0 to 8.0 spans at least 5 bytes (4-5-6-7-8).

But to transfer just a bool or a few bytes sounds strange to me.
What is it that you REALLY want to achieve in the end ?
 
JesperMP said:
Yes.
What is it that you REALLY want to achieve in the end ?

Well, i must have in program some DB-s (client request), and in that DB-s i must have informations like "start motor on dislocated end".... that informatiom nust be bool and at adress +12.0

now i nead to start that motor... i think that best way is to transfer that byte to db of dislocated cpu and program at that cpu starts dislocated motor when there is information

weird isn't it :)
 
That sounds like you are sending proces critical commands and status signals by means of messaging.
So you have to send the same telegram twice, once to turn a bit ON and once to turn the bit OFF again. And the same for the status signals the other way. This is a cludge if you ask me.
I would use i/o datatransfer via Profibus for the same job. It is simple, reliable and you get good diagnostics if (when) something goes wrong.
 
JesperMP said:
That sounds like you are sending proces critical commands and status signals by means of messaging.
So you have to send the same telegram twice, once to turn a bit ON and once to turn the bit OFF again. And the same for the status signals the other way. This is a cludge if you ask me.
I would use i/o datatransfer via Profibus for the same job. It is simple, reliable and you get good diagnostics if (when) something goes wrong.

Can you give me advice how to use i/o datatransfer?

Please be detailed, i am really a newbie
 
I am extremely busy at the moment, so I have to put it shortly.

If data has to be transferred between two stations cyclically, then it is a good idea to exchange the data via the i/o image of the two stations. After you set it up, it runs automatically.
What you have to do is to define all the signals and values that must be transferred in both directions, and then fill the outputs and query the inputs in both programs, just as if they were regular inputs and outputs.
You can NOT manipulate all the DBs freely in the remote CPU, such as it seems your clients suggested method seems to require. This is good thing, just think of the havoc you can create if you make a small programming error.

There are two variants:
1. One Station is master, the other is slave.
2. Both stations are masters, a DP/DP coupler appears a slave to both masters and transfers the i/o back and forth between the two stations.

Either way, it is easiest to put both stations in the same STEP7 project. If you cannot do that, it is still possible, but takes some more work to coordinate the two projects.

About the details, if noone else can help you out, I suggest you search for sample projects on Siemens support. Use "DP/DP coupler" as the search string.
 
If your doing control interface where you want instant reaction, I would look at DP Couplers.

This is a cheap device which will sit between both PLC's profibus networks and is basically an I/O connection, not comms.

Inputs on one side are outputs on the other, you would treat them the same as any other I/O.
 
Hello all!

For now i am configuring dp master/slave system... but have one question...

i have configured hardware, one cp set to master, second to slave, on master i attached second cp....

now i have next:

when i insert dp_send in ob1 of master, and going to set connection on "cpladdr" i do the "right click - connections" and there i get just "cp master" on list of "available dp masters/ dp slaves"

i double check everything and all is done "by book", can you give me some advices, please
 

Similar Topics

Hello everyone, friends. I need help with something. I want to read and change Bit and Byte numbers via HMI. I found a code snippet for this as...
Replies
18
Views
3,032
Our system utilises INPUT_BYTE to capture NMEA0183 ASCII stream which sends data to the NOM multiple times a second. The NOM module can either be...
Replies
0
Views
386
Hello everyone :) I just want to start with learning PLC programming, so I need advice. I have SIMATIC S7-1200, CPU with integrated memory...
Replies
5
Views
931
I have a C-More HMI that changes my PLC String from "Machine Status" to "aMhcni etStasu" . There is an option with other objects that have string...
Replies
15
Views
3,473
Hello I have got a problem with positive edge from "system clock memory byte" in Tia Portal. I would like to change byte"system clock memory"...
Replies
27
Views
3,607
Back
Top Bottom