S7-1200 - Tag-move to DB?

Dariusch

Member
Join Date
Sep 2003
Posts
284
Hi all,

I have to move different types of data into af DB. The is to be used for an other PLC/SCADA to be read.

I have a S7-1215 with a profibus slave. The DB I have to "make" has to be accesed from the profibus.
It is programmed in TIA V13

I need to fill in bits, int, real etc.

for example I have the following in the PLC Tag list:

BP01_Alarm, bool, %I0.2
xx_Alarm, bool, %I0.3
xx_Alarm, bool, %I0.4
xx_Alarm, bool, %I0.5

HMI_Start, bool, %M0.0
HMI_xx, bool, %M0.1
HMI_xx, bool, %M0.2
HMI_xx, bool, %M0.3

HMI_xx, Real, %MD200
HMI_xx, Real, %MD204
HMI_xx, Real, %MD208
HMI_xx, Real, %MD212

Do I have to make "MOV" for every data or is there som "right" way to copy it to a DB?


Thank you in advance.

Dariusch
 
Last edited:
Here is a small SCL FC that uses POKE_BLK to copy data from one area of memory to another. The attached image shows it being called from another FC. I called the FC 'BlockCopy'. It doesn't include facilities to make sure you don't go beyond the end of a DB, these weren't available when I coded it.

These are the inputs to the FC
Code:
fromTagArea       Byte        TagArea to copy from
fromDBNumber      DInt        DB to copy from, 0 from non DB locations
fromStartByte     DInt        Starting byte to copy from
NumberOfBytes     DInt        Number of bytes to copy
toTagArea         Byte        TagArea to copy to
toDBNumber        DInt        DB to copy to, 0 from non DB locations
toStartByte       DInt        Starting byte to copy to
This is the code. Lines preceded by // are comments
Code:
// TagArea for Inputs is B#16#81
// TagArea for Outputs is B#16#82
// TagArea for M is B#16#83
// TagArea for DB is B#16#84
// For any other TagArea than DB use 0 as the DBNumber


POKE_BLK(area_src:=#fromTagArea,
         dbNumber_src:=#fromDBNumber,
         byteOffset_src:=#fromStartByte,
         area_dest:=#toTagArea,
         dbNumber_dest:=#toDBNumber,
         byteOffset_dest:=#toStartByte,
         count:=#NumberOfBytes);

Call BlockCopy.jpg
 

Similar Topics

Pretty simple question, but I was wondering how I can set the Analog Output 1 of an S7-1200 (DC/DC/Relay) to be proportional to a data tag. I...
Replies
1
Views
848
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
230
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
75
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
118
commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
122
Back
Top Bottom