Error In TIA but not in Step 7 GET/PUT

Ranjith

Member
Join Date
May 2007
Location
Melbourne
Posts
316
I used the attached code in Step 7 to Transfer Data between PLC's without a problem.
I am trying to use the same code in TIA V13 SP2 but errors appear in Networks 2 and 3 in lines 17 and 21. Looks like I need to insert something in front of those two lines. ADDR_1 :=
RD_1 :=
Appreciate your valuable time and help.

Attached file is the source code. I changed the type from AWL to TXT for me to upload.
Thanks
 
I can't find any ADDR_1 and RD_1 in the attached file. ADDR_1 and RD_1 are the addresses of the DB that you are copying from and to. ADDR_1 is the DB address on the partner CPU and the RD_1 is the local DB to be written or read to.
 
Thanks cardosocea for the reply.
You cannot really see it with the TXT file.
Unless import the source code to a project by changing TXT to AWL.
 
did you build this code yourself? or copy/paste? or converted it from Step7?

it seems that in network 1 the addr_1 and rd_1 are constructed... and all from data relative from the first input bool

like it assumes that al the parameters (in/out/stat) are in the correct places as programmed in network 1.

if there is a difference however this wont work and the adresses are copied to wrong place

there are better ways of transferring the SndData and RcvData addresses to the addr_1 and rd_1

and what are the errors you are getting? maybe you are forced to litelary fill in the addr_1 and rd_1
 
it seems that in network 1 the addr_1 and rd_1 are constructed... and all from data relative from the first input bool

like it assumes that al the parameters (in/out/stat) are in the correct places as programmed in network 1.

if there is a difference however this wont work and the adresses are copied to wrong place

Ok I just loaded the FB in a TIA project I think the problem is the addresses thing. And the cause is, the S7-300 GET/PUT has only 1 addr_1 and rd_1.
In TIA it uses different GET block, with addr_1..4 and rd_1..4 so all addresses are shifted and so should the addressing in the code in network 1
 
FB1 compiles ok in my TIA V13 (SP1, UPD9) after migrating the Step7 project, I get warnings for the parameters that are not filled in.

get.jpg
 
TIA hides the unused addresses but they are there.

Yes I understand that but what I mean there must be a size difference in the GET/PUT instances between TIA and Step7.

Network 1, this is still good :
Code:
//    move the RcvData "any" into GetCtrl ADDR_1 and RD_1 "any"
      L D [ AR1 , P#18.0 ]       // RcvData Bytes 0-3
      T D [ AR1 , P#36.0 ]       // GetCtrl Bytes 0-3 of ADDR_1
      T D [ AR1 , P#76.0 ]       // GetCtrl Bytes 0-3 of RD_1
but the next is wrong:
Code:
//    move the SndData "any" into PutCtrl ADDR_1 and SD_1 "any"
      L D [ AR1 , P#8.0 ]        // SndData Bytes 0-3
      T D [ AR1 , P#126.0 ]      // PutCtrl Bytes 0-3 of ADDR_1
      T D [ AR1 , P#166.0 ]      // PutCtrl Bytes 0-3 of SD_1
this assumes ADDR_1 start at P#126, but the starting offset of "PutCtrl" starts at byte 628, so ADDR_1 is at p#636.0

I think this must be the problem
 
I've not got TIA right now, did you import FB1 and compile it with no errors?

Yes I imported that FB1 as .AWL source right into TIA (with a S7-300 project)
Compile is good, only those warnings you mentioned.


edit:
I just glanced again at the FB1 and saw "SFB14" mentioned so it must have been for an S7-400.
So now i want to know if that makes a difference but can't check it right now :mad: because I just got home...
 
Last edited:
Thanks to Both of you for spending time to help me.

What wimpiesplc saying is right.
In TIA GET/PUT structure is different.
I can compile FB1 for CPU 300 with only warnings.
But cannot compile with a S7 1516.
I changed the NW1 with the correct Local addresses but still comes up with the same errors.
Pl See attached doc for more info.
 
You need to use GET for the 1500 CPU. Access to system block parameters like GET via indirect addressing is not supported (as far as I can see) as they have probably been coded with optimised memory access. Copy your anypointer data into some temp variables and pass them to the GET block.

e.g.

ran1.jpg
 
Last edited:
Here's the block call in ladder (I've not shown your application logic for simplicity). You also have to configure the GET block using the toolbox icon on the block.

Ran2.jpg
 
ah, just tried it also for a few CPU families and had similar conclusions, and when trying with the S7-400 the addresses are correct and only warnings. And with the 1500 it gives the errors.

I would go with the way L D[AR2,P#0.0] suggests (anyway).

succes
 

Similar Topics

hi everyone, I have a problem, it seems that in somewhere on the programming the reference tends to lost mabye one time at day. I write this...
Replies
0
Views
73
Hello forum, I wanted to install Step 7 TIA Portal V17 on my laptop (Win10 64 Bit). Unfortunately, I am getting this (error:14667)...
Replies
0
Views
485
Hi, At the moment, If the user fails to provide a valid username/password, the image attached appears "Invalid password or user name. Logon has...
Replies
12
Views
1,496
I am trying to backup a program on a Windows 10 IPC running an application written in TIA v16 and download an update. The system has a Siemens...
Replies
2
Views
2,102
Hello all, I am working on a project using an s7-1200 and tia portal v17. The project is for stepper motor control for a SMD23E2 motor. I am...
Replies
3
Views
4,972
Back
Top Bottom