Technical Forum

STEP 7 Additional Software

How to copy data block in SCL

Thread Starter: prasad.sawantdesai   Started: 7/5/2013 10:49 AM   Replies: 7

« Previous thread Next thread »
Page 1 of 1 (8 items)
  7/5/2013, 10:49 AM
Joined 9/27/2012
Last visit: 10/7/2014
Posts: 53
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Dear Experts,

How to copy data block in SCL?sad
 
For example I have data block of 1000 bytes and I need to copy 240 bytes consecutively in a separate data block(240 Byte).
Thanks in advance..

Regards,
Prasad Sawantdesai
Top
  7/5/2013, 10:56 AM
Joined 1/28/2009
Last visit: 10/20/2014
Posts: 4697
Rating:
Rated: Excellent [4.22 out of 5 / rated 698 time(s)]. (698) 
Users with special expertise supervising conferences
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
prasad.sawantdesai wrote:
Dear Experts,

How to copy data block in SCL?sad
 
For example I have data block of 1000 bytes and I need to copy 240 bytes consecutively in a separate data block(240 Byte).
Thanks in advance..

Regards,
Prasad Sawantdesai


BLKMOV in SCL

Solution from Smiffy:



Best regards
Hamid Hosseini
Top
Thank you for this post from:
  7/5/2013, 1:51 PM
Joined 9/27/2012
Last visit: 10/7/2014
Posts: 53
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Dear hdhosseini,


Thanks for the quick answer. It worked well...Rnf:lblSmileyTooltip_

Thank you so much.

Regards,
Prasad
Top
  2/17/2014, 7:47 PM
Joined 11/19/2013
Last visit: 6/23/2014
Posts: 353
Rating:
Rated: Excellent [5 out of 5 / rated 3 time(s)]. (3) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
new question is splittet to  Do you have this code but then for a s7-1200 plc (1214C).

Best regards / viele Grüße
GrasserF
Top
  10/17/2014, 1:48 PM
Joined 11/29/2011
Last visit: 10/19/2014
Posts: 215
Rating:
Rated: Outstanding [4 out of 5 / rated 13 time(s)]. (13) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi, 

how do you define the ANY parameters if you want to copy data from a shered DB to a LOCAL varible?

Cheers:

MicroMan
Top
  10/17/2014, 3:06 PM
Joined 12/16/2012
Last visit: 10/20/2014
Posts: 95
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi

I think that in the case of a LOCAL you have to write 0 in the DBNumber and 16#86 in the MemoryArea, but it has to be tested.

http://masteca.com/home/?lang=en
Top
Thank you for this post from:
  10/17/2014, 3:08 PM
Joined 1/17/2007
Last visit: 10/20/2014
Posts: 1003
Rating:
Rated: Excellent [4.4 out of 5 / rated 211 time(s)]. (211) 
Users with special expertise supervising conferences
Rated: Excellent [5 out of 5 / rated 2 time(s)]. (2) 
Similar to the above. You simply point the destination ANY pointer of your local variable.
The code below should give you some ideas.
Some points of note about the code.
i) In the form presented here it can only handle a maximum DB size of 8192 bytes. I can provide a solution that gets round this limit, but it nakes the code a bit harder to understand. If you want this option then tell me.
ii) The BLKMOV function will only copy as many data bytes as the destination variable will hold, REGARDLESS of how many bytes are specified at the COPY_LEN input. So in this example as we are copying to an integer, only 2 bytes will be copied.


Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots.

So far, the universe is winning...
Top
Thank you for this post from:
  10/17/2014, 5:26 PM
Joined 11/29/2011
Last visit: 10/19/2014
Posts: 215
Rating:
Rated: Outstanding [4 out of 5 / rated 13 time(s)]. (13) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
HI, 

Thanks. That was brilliant!

Cheers:

MicroMan
Top
Thank you for this post from:
Page 1 of 1 (8 items)
Actions