plc.myforum.ro Forum Index plc.myforum.ro
PLCs users www.plc.myforum.ro!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MOVE_BLK_VARIANT error 16#8382

 
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> SIMATIC Automation Systems -Reg.U
View previous topic :: View next topic  
Author Message
socrames
Junior
Junior


Joined: 15 Jan 2019
Posts: 14

PostPosted: 09/02/2021 11:27    Post subject: MOVE_BLK_VARIANT error 16#8382 Reply with quote

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
View user's profile Send private message
Prahaap Arheb
Junior
Junior


Joined: 30 Oct 2018
Posts: 2

PostPosted: 09/02/2021 15:06    Post subject: Reply with quote

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;


MOVE_BLK_VARIANT error 16#8382

MOVE_BLK_VARIANT error 16#8382
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
View user's profile Send private message
socrames
Junior
Junior


Joined: 15 Jan 2019
Posts: 14

PostPosted: 10/02/2021 10:52    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> SIMATIC Automation Systems -Reg.U All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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