4/7/2017 10:54 AM | |
Posts: 10 Rating: (0) |
Hi Bengineer I just wanted to say thanks to both of you for this post, and also to add the way that I have dealt with this issue. It works perfectly and is done simply. I am using this to get large amounts of data over an s7 connection using fb_get and any pointers . I dealt with the issue by treating it as smiffy said, but then I use an "at" declaration to break it down allowing me to use MSB also In the declaration area I have the following variables declared dw_Addy :DWORD; // offset address used in any pointers at_ADDY AT dw_ADDY :STRUCT // breakdown of offset address used in any pointers so you can see above I have a dword that I have broken out using the at instruction into 1 word for LSB and 2 further bytes, 1 byte for MSB and 1 byte that is not used in the program then in my code I have the following:- // the following turns my byte address (dn_Byte Addy) into a Bit address(dw_Addy) by multiplying by 8 dw_Addy := DINT_TO_DWORD (dn_Byte Addy*8); // I then write to my any pointer using a bit mask and by anding the msb and lsb with only bits required Hope this helps whoever is out there, this works like a dream, if anyone needs a copy of my actual block , download attached working version. I have removed some parts of the irrelevant code here to avoid causing confusion "Work smarter not harder" "if you don't use it you loose it" AttachmentFb_DataGet.txt (331 Downloads) |
This contribution was helpful to1 thankful Users |
Follow us on