Siemens data blocks

Jonnie_R

Member
Join Date
Feb 2012
Location
Brecon
Posts
216
Hi,


Still a relative newbie to TIA and Siemens.



I am reading and writing data from an S7-1200 into Movicon SCADA, and using data blocks to do this. To make it more efficient I will be packing data into bytes, rather than transmitting lots of individual bits.


In TIA is it a case of manually moving via a MOVE block, the data block byte to a tag byte so I can use individual bits, or am I missing something? Or of course am I over complicating it?


Thanks
 
X

Hi,

In TIA you can use %X0, %X1, etc as adressing single bits on byte's.

Kind regards,
C

https://support.industry.siemens.co...word-by-word-and-symbolically-?dti=0&lc=en-WW

Hi,


Still a relative newbie to TIA and Siemens.



I am reading and writing data from an S7-1200 into Movicon SCADA, and using data blocks to do this. To make it more efficient I will be packing data into bytes, rather than transmitting lots of individual bits.


In TIA is it a case of manually moving via a MOVE block, the data block byte to a tag byte so I can use individual bits, or am I missing something? Or of course am I over complicating it?


Thanks
 
There are several ways to do it. This my recommendation:

Define the data area to be shared by a user data type.
Just declare the various bits as BOOLs with a readable symbolic name.
Declare all the BOOLs as one continous block.
example User Data Type "myType"
motor_1_on : BOOL ;
motor_1_error : BOOL ;
motor_2_on : BOOL ;
motor_2_error : BOOL ;
etc.

Create a shared DB, and set up one or more variables that is defined by the above Data Type
Example Datablock "HMI_data".
area_1 : myType
area_2 : myType
etc.

Now program the FC or FB that handles the object(s) in question.
Add an output to the FC or FB that is defined by the user Data Type.
Example FC "my_FC"
...
OUT : hmi_data : myType
...
(code)
#hmi_data.motor_1_on := {some conditions}

Now call the FC in some higher level calling block, for example OB1.
When you call "my_FC", specify on the OUT pin "hmi_data" that the data is to be sent to "hmi_data".area_1

In the HMI, you can access all the bits in "hmi_data" as one block if you wich to do so.

As soon as you get the hang of it, you will see how you can structure the data and programs in such a way that you achieve that you program the code in the FC without having to think about where it is in the data being sent to the HMI.
Whatever you do, avoid anything that smacks of absolute addressing.
 

Similar Topics

Hi everyone, I am normally not in Siemens PLCs, so I have a relatively beginner question. In a data block (DB3), I added a few rows to it. When...
Replies
8
Views
1,957
I'm trying to locate the usage of hidden data blocks used only by the processor. The block folder doen not contain this data block. Is there...
Replies
2
Views
1,644
I've got a data block, DB310, that contains process information entered from an HMI. Every time the processor is cycled from start to stop to...
Replies
12
Views
15,517
Hello Guys, Is there any way to export / import the data blocks from EXCEL files? We tried in S7 and find very difficult to export. In EXCEL...
Replies
5
Views
16,137
Hi! For my application (in an S7-317 plc) I want to create two DB's. These DB's are filled with an array of a certain UDT. (Array[1..100] of...
Replies
5
Views
14,800
Back
Top Bottom