Robert Carlsson
Member
Hey all!
I am developing a general function block that will read quite some data from a PROFIBUS slave. This data is received with a length of 240 bytes at most at a time, but I need to save a lot more data than that. The data is received in a 241 byte long record. Now I've created a DB using SFC22 (CREAT_DB), and I want to put all the data in that DB, byte for byte. The data is variable though, it may not always be 240 byte.
I was thinking to save byte 7-n (n being the last byte of data) into the newly created DB, and then when reading the data from the next station (got a bunch of stations), just put the data from the second station after the first, and so on, with a couple of variables to keep track of what data belongs to what station. How do I do to accomplish this? I was thinking about SFC20 (BLKMOV), but it only takes a whole array as parameter and puts it in the beginning of the destination, not with an offset, as is needed in my function block.
Basically, I want to save a portion of an array into a second array, and fill this second array with more and more data from different stations.
I am developing a general function block that will read quite some data from a PROFIBUS slave. This data is received with a length of 240 bytes at most at a time, but I need to save a lot more data than that. The data is received in a 241 byte long record. Now I've created a DB using SFC22 (CREAT_DB), and I want to put all the data in that DB, byte for byte. The data is variable though, it may not always be 240 byte.
I was thinking to save byte 7-n (n being the last byte of data) into the newly created DB, and then when reading the data from the next station (got a bunch of stations), just put the data from the second station after the first, and so on, with a couple of variables to keep track of what data belongs to what station. How do I do to accomplish this? I was thinking about SFC20 (BLKMOV), but it only takes a whole array as parameter and puts it in the beginning of the destination, not with an offset, as is needed in my function block.
Basically, I want to save a portion of an array into a second array, and fill this second array with more and more data from different stations.