8/6/2016 5:03 PM | |
Joined: 1/17/2006 Last visit: 11/7/2024 Posts: 554 Rating: (29) |
Hi. I have two PLCs S7-400 (410 and 416) in different projects. The 1st is programmed in PCS7 v8.0 and the 2nd in STEP7 v5.5. I want to exchange some data btw them and I did a s7-connection (unspecified partner) with TCP-IP. The connection is ok, but I still have doubt about which blocks can I use to exchange the data. My issues: 1) Ralfinio told about the BSEND and BRECV blocks. I know how to configure this block in STEP7 side, but in PCS7 side I don't know how to enter the pointer (any type) in the block. 2) Are there the blocks SEND_R and REC_R for STEP7 or only PCS7 ? Best regards, Berg |
Last edited by: Berg at: 8/9/2016 11:29:51 PMLast edited by: Berg at: 8/9/2016 11:30:50 PM"Educate the children and it won't be necessary to punish the men." |
|
8/6/2016 8:12 PM | |
Joined: 11/29/2011 Last visit: 10/24/2024 Posts: 1360 Rating: (232) |
Hi, About how to connect ANY pointer see the FAQ below. Basically "Rigth Click" on the block IO -> "Interconnect to Address" then you browse the structure you want to connect. Read more below: How can you access user data blocks with SCL/CFC? Regarding to communication blocks in Step7, see the System Software for S7-300/400 System and Standard Functions Volume 1 and Volume 2 manual under chapter "22 S7 Communication". I hope I could help! |
Last edited by: MicroMan at: 8/6/2016 10:19:38 PM- What you read here, please check with manuals and your requirements. |
|
This contribution was helpful to1 thankful Users |
8/7/2016 9:00 AM | |
Joined: 6/23/2008 Last visit: 11/13/2024 Posts: 1168 Rating: (283)
|
Hello Berg,
When you do like this, you will connect an address of a DB to an input of your block (BSEND/BRCV). But you will recognise that the length-information in the pointer will be missing. But the lenght-information in the any-pointer is required at the BSEND/BRCV-blocks (see help of BSEND/BRCV). Even if you try to edit the full ANY-pointer including the length-information manually in CFC you will have no success. This is the reason why I said 'It's not possible to use a full ANY-pointer in CFC' in this thread. If you want to use BSEND/BRCV with CFC you need to create an own block (in e.g. by SCL) wich will create the ANY-pointer internally and call the BSEND/BRCV and hand over the ANY-pointer. Best regards... |
Last edited by: mark1507 at: 8/7/2016 10:26:10 AMLast edited by: mark1507 at: 8/8/2016 12:50:51 PM"Expert" does not necessarily mean Siemens employee. Please cross-check your requirements always with official Siemens documentation. Also "Experts" are pleased about feedback. Please don't send support requests as PM. Questioners who don't follow up their thread will be put to my list of users to be ignored. |
|
This contribution was helpful to1 thankful Users |
8/7/2016 9:54 AM | |
Joined: 11/29/2011 Last visit: 10/24/2024 Posts: 1360 Rating: (232) |
Hi Mark,
Based on my previous question raised here about ANY pointers [Topic (read)] Is there any way to read out the address of a Static variable of an FB? My above statement is also supported by my experience. So I think my above comment is valid. |
Last edited by: MicroMan at: 8/7/2016 11:03:49 AM- What you read here, please check with manuals and your requirements. |
|
This contribution was helpful to1 thankful Users |
8/7/2016 11:24 AM | |
Joined: 6/23/2008 Last visit: 11/13/2024 Posts: 1168 Rating: (283)
|
Hello MicroMan, Berg and other (future) readers, Berg's topic comes up from time to time and this is why I wanted to give a little bit more detailed answer... I just wanted to express that conneting e.g. the parameter SD_1 of BSEND by "Rigth Click on the block IO -> Interconnect to Address" is not sufficient in regard of Berg's topic. You just get the start adress connected to SD_1 when doing like this and the lenght information, wich is required in the ANY-pointer used at SD_1 of BESEND, will be missing. There will be no error-message by CFC when connecting like this. Also no error or warning when compiling CFC. But when loaded to the CPU the BSEND will deliver an error. Here a quote from the help of BSEND: "Note: It sounds strange because the BSEND has a seperate input 'LEN' wich is for the lenght to be send. Despite this fact you need to specify the lenght in the ANY-pointer. Here an other quote from the help of BSEND wich explains the background: "The start address and the maximum length of the data to be sent are specified by SD_1. You can determine the job-specific length of the data field with LEN. In this case, LEN replaces the length section of SD_1." Even if 'LEN' replaces the length section of SD_1 it must not be left out in the ANY-pointer at SD_1. Unfortunately the syntax "p# DB10.DBX5.0 Byte 10" can not be used in CFC. With the block BRCV the "problem" is similar... If you read the help of BRCV (explanation of the parameter RD_1) you will find the same information like for the BSEND. Quote: "Note: If you click on the link "Common Parameters of the SFBs/FBs and SFC/FC for the S7 communication" in that help page and read the information given there, you may come to the conclusion that the lenght information in the ANY-pointer may be useless at the block BRCV. Anyhow, as per my expirience you can not leave the lenght information out here, too. So, MicroMan's link "How can you access user data blocks with SCL/CFC?" is a good starting point to solve that issue, but the information in regard to BSEND/BRCV that the lenght needs to be added to the ANY-pointer is not handeled in that FAQ. @Berg: Again I am offering to send a SCL-source to you. One for the BRCV, another for BSEND. This blocks (with other symbolic names) will have three inputs (DB-No, Start-address and lenght) as INT instead of the ANY-pointer. This user blocks wil call the corresponding block (BRCV or BSEND) internally. Best regards... P.S.: In e.g. to connect a value of a DB to an input of a block in CFC, the "Rigth Click on the block IO -> Interconnect to Address" can be used (if data types are matching) ... |
Last edited by: mark1507 at: 8/7/2016 11:30:08 AMLast edited by: mark1507 at: 8/7/2016 11:47:48 AMLast edited by: mark1507 at: 8/7/2016 8:55:13 PM"Expert" does not necessarily mean Siemens employee. Please cross-check your requirements always with official Siemens documentation. Also "Experts" are pleased about feedback. Please don't send support requests as PM. Questioners who don't follow up their thread will be put to my list of users to be ignored. |
|
This contribution was helpful to4 thankful Users |
Follow us on