 |
plc.myforum.ro PLCs users www.plc.myforum.ro!
|
| View previous topic :: View next topic |
| Author |
Message |
socrames Junior

Joined: 15 Jan 2019 Posts: 14
|
Posted: 09/02/2021 11:27 Post subject: MOVE_BLK_VARIANT error 16#8382 |
|
|
Hi there,
I'm working inside a non-optimized global DB : my DB83 has components of the type "Array[0..15] of Bool"
I'm trying to copy the values of 6 MW from one place to another.
Value of MW302-MW307 copied to MW2302-MW2307 inside global DB83.
So I used MOVE_BLK_VARIANT with the following parameters :
- src: %DB83
- count: 6
- src_index: 302
- dest_index: 2302
The error code I get (16#8382) seems to be linked to the value of parameter SRC_INDEX being negative although I've put 302 as SRC_INDEX.
Am I missing something here please ?
Thanks for your inputs
[img]http://www.99poze.ro/h/3cfafb5ec69fdc78758dda6938d23499.jpg[/img] |
|
| Back to top |
|
 |
Prahaap Arheb Junior

Joined: 30 Oct 2018 Posts: 2
|
Posted: 09/02/2021 15:06 Post subject: |
|
|
f | Code: | or #idx:=0 to 9 do
MOVE_BLK_VARIANT(SRC := #Source_data>,
COUNT := 1
SRC_INDEX := 0
DEST_INDEX := must be 0 (at S7-1200!!!)
DEST => Dest_data[#idx]);
End_for; |
Rules for data copy operations
• To copy the Bool data type, use SET_BF, RESET_BF, R, S, or output coil (LAD)
(Page 224)
• To copy a single elementary data type, use MOVE
• To copy an array of an elementary data type, use MOVE_BLK or UMOVE_BLK
• To copy a structure, use MOVE
• To copy a string, use S_MOVE (Page 339)
• To copy a single character in a string, use MOVE
• The MOVE_BLK and UMOVE_BLK instructions cannot be used to copy arrays or
structures to the I, Q, or M memory areas.
https://cache.industry.siemens.com/dl/files/465/36932465/att_106119/v1/s71200_system_manual_en-US_en-US.pdf |
|
| Back to top |
|
 |
socrames Junior

Joined: 15 Jan 2019 Posts: 14
|
Posted: 10/02/2021 10:52 Post subject: |
|
|
Thanks Prahaap Arheb. I understand that with MOVE_BLK_VARIANT, I need to copy the arrays one by one, so a for-loop is needed.
Eventually, I ended up using a combination of PEEK, POKE and POKE_BLK to reach my goal
But I find very useful your "Rules for data copy operations"
I'll keep it in mind for future use |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro
|