You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old August 3rd, 2017, 02:37 AM   #1
Ranjith
Member
Australia

Ranjith is offline
 
Join Date: May 2007
Location: Melbourne
Posts: 260
Error In TIA but not in Step 7 GET/PUT

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
Attached Files
File Type: txt FB1.TXT (4.1 KB, 36 views)
  Reply With Quote
Old August 3rd, 2017, 03:33 AM   #2
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Duxford
Posts: 377
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.
  Reply With Quote
Old August 3rd, 2017, 05:42 AM   #3
Ranjith
Member
Australia

Ranjith is offline
 
Join Date: May 2007
Location: Melbourne
Posts: 260
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.
  Reply With Quote
Old August 3rd, 2017, 06:37 AM   #4
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Duxford
Posts: 377
That won't be possible for now as I don't have TIA Portal in here at the moment.
I'll have a look at home.
  Reply With Quote
Old August 3rd, 2017, 07:39 AM   #5
wimpiesplc
Member
Netherlands

wimpiesplc is offline
 
Join Date: Feb 2012
Location: Netherlands
Posts: 296
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
  Reply With Quote
Old August 3rd, 2017, 10:46 AM   #6
wimpiesplc
Member
Netherlands

wimpiesplc is offline
 
Join Date: Feb 2012
Location: Netherlands
Posts: 296
Quote:
Originally Posted by wimpiesplc View Post
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
  Reply With Quote
Old August 3rd, 2017, 11:03 AM   #7
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,414
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.
Attached Images
File Type: jpg get.jpg (54.3 KB, 62 views)
  Reply With Quote
Old August 3rd, 2017, 11:04 AM   #8
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,414
Quote:
Originally Posted by wimpiesplc View Post
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
TIA hides the unused addresses but they are there.
  Reply With Quote
Old August 3rd, 2017, 05:08 PM   #9
wimpiesplc
Member
Netherlands

wimpiesplc is offline
 
Join Date: Feb 2012
Location: Netherlands
Posts: 296
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
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
  Reply With Quote
Old August 3rd, 2017, 05:22 PM   #10
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,414
I've not got TIA right now, did you import FB1 and compile it with no errors?
  Reply With Quote
Old August 3rd, 2017, 06:00 PM   #11
wimpiesplc
Member
Netherlands

wimpiesplc is offline
 
Join Date: Feb 2012
Location: Netherlands
Posts: 296
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
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 because I just got home...

Last edited by wimpiesplc; August 3rd, 2017 at 06:10 PM.
  Reply With Quote
Old August 3rd, 2017, 09:50 PM   #12
Ranjith
Member
Australia

Ranjith is offline
 
Join Date: May 2007
Location: Melbourne
Posts: 260
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.
Attached Files
File Type: docx FB1 Error.docx (151.2 KB, 8 views)
  Reply With Quote
Old August 4th, 2017, 09:06 AM   #13
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,414
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.
Attached Images
File Type: jpg ran1.jpg (30.1 KB, 51 views)

Last edited by L D[AR2,P#0.0]; August 4th, 2017 at 09:08 AM.
  Reply With Quote
Old August 4th, 2017, 09:08 AM   #14
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,414
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.
Attached Images
File Type: jpg Ran2.jpg (24.5 KB, 52 views)
  Reply With Quote
Old August 4th, 2017, 11:33 AM   #15
wimpiesplc
Member
Netherlands

wimpiesplc is offline
 
Join Date: Feb 2012
Location: Netherlands
Posts: 296
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
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
run Step 7 without TIA Portal dmned64 LIVE PLC Questions And Answers 4 June 7th, 2017 05:39 AM
Siemens SIMATIC TI505 (Texas Instruments) conversion to AB antsrealm LIVE PLC Questions And Answers 17 May 25th, 2015 01:13 AM
S7 Sequence Programming Solution ? Jim.M LIVE PLC Questions And Answers 54 March 21st, 2012 11:22 AM
Can you recommend the proper direction on SLC500 xcode LIVE PLC Questions And Answers 96 October 22nd, 2009 01:20 AM
Creating a register array to sequence rsdoran LIVE PLC Questions And Answers 15 October 17th, 2003 11:22 PM


All times are GMT -5. The time now is 10:12 PM.


.