10/29/2011 1:00 PM | |
Posts: 14 Rating:
|
Hi, how i can to move 8 bytes of type DT in Data block using function SFC20 and AR1 in DSTBLK? thanks |
10/29/2011 3:09 PM | |
Joined: 1/28/2009 Last visit: 9/2/2024 Posts: 6846 Rating:
|
Please try followingways of implementing what you want: [code]CALL "READ_CLK" RET_VAL:=#ret CDT :=#da //copy CALL "BLKMOV" Attachmenttest.zip (288 Downloads) |
10/29/2011 7:16 PM | |
Joined: 1/28/2009 Last visit: 9/2/2024 Posts: 6846 Rating:
|
Dear member, Please check the following solution. [code] CALL "READ_CLK" RET_VAL:=#ret CDT :=#da L W#16#1002 //Type BYTE fix T LW 32 L 8 //Number of bytes 8 in this case T LW 34 L 2 //Target DB T LW 36 L 0 //where start to write SLD 3 OD DW#16#84000000 T LD 38 CALL "BLKMOV" SRCBLK :=#da RET_VAL:=#ret2 DSTBLK :=#any_hd[/code] Best regards AttachmentANY.zip (421 Downloads) |
Last edited by: hdhosseini at: 10/29/2011 7:44 PM |
|
10/31/2011 8:36 AM | |
Joined: 1/28/2009 Last visit: 9/2/2024 Posts: 6846 Rating:
|
[quote user="waard"] big thanks to you.. just two questions: I read in Berger's book that SLD3 using to converse to point format, that very impotant, but not understandable. Could you tell why do this? And after that string you write OD DW#16#84000000 and the same question: Could you tell why do this? Thanks and sorry for my english Dear waard, 1-When you want to access Byte address by using area pointernotation,As you may remember structure of the pointer for indirect addressing (both Area-internal pointer and Area- crossing pointer), you need to skip bit numbers 0,1 and 2. This is done by SLD3 to adjust pointer address for Byte number access. ![]() ![]() 1000 0RRR 0000 0BBB BBBB BBBB BBBB BXXX X:Bit address B:Byte address R:Operand area 2-Format and data structure for parameter type ANY is illustrated throughly in the online manual of STEP7 which you can find it in attachment. The hex number "DW#16#84000000" you are talking about is an area pointer which is formed easily like this: 1000 0100 0000 0000 0000 0000 0000 0000 ~DW#16#84000000 X:Bit address B:Byte address R:Operand area (100-for datablock) Also check this: Step 7 Indirect addressing FAQ & Examples collection Best regards, Hamid Hosseini AttachmentANY.zip (282 Downloads) |
This contribution was helpful to
2 thankful Users |
10/31/2011 9:11 AM | |
Joined: 1/28/2009 Last visit: 9/2/2024 Posts: 6846 Rating:
|
I provided codes for you in previous post, download it: (Attachment: ![]() and see what is actually going on there.There are some misunderstandings, I point them out in attachment. ORGANIZATION_BLOCK "CYCL_EXC" |
Last edited by: hdhosseini at: 9/1/2018 5:48:25 AM |
|
Follow us on