9/29/2021 11:27 PM | |
Joined: 9/27/2006 Last visit: 11/4/2024 Posts: 12293 Rating: (2690) |
Hello Oluwasedago; A variable of datatype REAL occupies 4 bytes (32 bits) and is formatted based on IEEE 754: look in the S7 online help or https://en.wikipedia.org/wiki/Single-precision_floating-point_format So your S7 address should be QDxxx, the D indicating a 4 byte value, or IDxxx, or DByy.DBDxxx. And you must format that address as a REAL (right click on the I or Q address to open the symbol table, mark it as REAL). Try it... Hope this helps, |
Last edited by: dchartier at: 09/29/2021 23:29:15 |
|
This contribution was helpful to1 thankful Users |
9/30/2021 9:24 AM | |
Joined: 3/30/2015 Last visit: 3/7/2024 Posts: 70 Rating: (1) |
Hello Daniel, Thank you very much! Now, I can view the real data as well as the Boolean data. I think I will delete the "Consistent" input and output configs and work only with the Non consistent ones, since I have a working platform now and do not really know how that would work on the Beckhoff side and do not know how to make them work on the Siemens side. I will probably just increase the Inout and Output bytes to be able to get more bytes for the real values transfer. I am very grateful for your time and help. Regards, David
|
10/4/2021 3:00 PM | |
Joined: 3/30/2015 Last visit: 3/7/2024 Posts: 70 Rating: (1) |
TIA V16 update 4, S71500 and Beckhoff Twincat 2.9 Hello, Please I have gone ahead to set up communication on the Beckhoff part and so far all hardware communication setup is perfectly fine. We have decided to use 2 X 64Bytes Inputs and outputs and 1 Byte Input and Output for Communication Check. 1 Byte Output_1: Communication Output Checks from Siemens (Address 10) 1 Byte Input_1: Communication Input check from Beckhoff (Address 13) We access bits from these and so far all is fine. For the Data Area, we plan to transfer various data in sections over: 64 Bytes Input_1: Data From Beckhoff_1 (Address 20..83) 64 Bytes Input_2: Data From Beckhoff_2 (Address 84..147) Here, we have sent some data from the beckhoff, but I cannot access it directly on the Siemens. Even when I check the direct address of IB, ID or IW, I get some strange data. I know the data is thee, but I do not know how to address to access it. I noticed while setting up my DB that the REAL data type tries to take 5 bytes instead of 4 bytes. When I drag the columns from ID20, the next one shows as ID25. I manually constructed the DB to have 4 bytes spacing. Please, could you help inform me of how to get these data with the right addressing? I have attached the set up and the data view from the beckhoff and also what I see in the Watch Table on TIA.
Attachment2.zip (675 Downloads) |
10/4/2021 9:13 PM | |
Joined: 9/27/2006 Last visit: 11/4/2024 Posts: 12293 Rating: (2690) |
Hello oluwasego; Here is a description of the SWAP nstruction in Step v16. You are right, the input can be eiher a Word ofr a DWord, it does not accepyt a REAL. https://support.industry.siemens.com/cs/ww/en/view/109773506/101023978763 BUT: User A_Dent had a similar issue as yours, with a Beckhoff PLC exchanging Real variables with a S7 PLC. Here you will find his description of the SWAP instruction in this case: Hope this helps, |
This contribution was helpful to1 thankful Users |
10/7/2021 3:16 PM | |
Joined: 3/30/2015 Last visit: 3/7/2024 Posts: 70 Rating: (1) |
Hello Daniel, THANK YOU VERY MUCH! I have been able to get the SWAP function right. I used a combination of the SWAP and the SLICING methods. 1- I created an FB for the slicing "Edian Conversion" 2- I created tags of MB with datatypes as Bytes. Then I moved the Input bytes from the DP inputs to this MBs. I also created an MD area output as DWORD tags. Since the SWAP function inly takes DWORD or WORD 3- I then used the MBs as input to my FB and the output as the MD. 4- I passed this MD (Dword) as input to the SWAP function and the output to the Conversion. The CONV is used to convert the DWORD to REAL in my DB. The SWAP function does the main job here! My solution is shown in the image for those who might need it. Thanks you once again. References: (1) https://support.industry.siemens.com/tf/ww/en/posts/issue-handling-real-inputs/213129/?page=0&pageSize=10 ( 2) https://support.industry.siemens.com/tf/ww/en/posts/swap-of-word-inside-real/123668
|
This contribution was helpful to1 thankful Users |
Follow us on