advertisement
from the Automation List department...
Siemens S7 ANY pointer
PLCs and related questions. topic
Posted by Jim Thorpe on 3 July, 2004 - 1:03 am
Maybe you could help me here.

How do you use the S7 ANY pointer with the BLKMOV to move a UDT to a peripheral Output Address area?

Any pointers dont seem to like addresses in this area so I cant use the FC even though I would love to. I dont have a problem using UDTs, just trying to get the ANY pointer to point to the correct address area.

ANY help would be appreciated (forgive the pun :))


Posted by ValRo on 7 July, 2004 - 10:25 am
BLKMOV is SFC20. I did not used it too much (and only for ordinary transfers). So, I checked the help and found that:
- SFC20 can not be used to access peripheral area.
- ANY pointer suports elementary data types (and UDT it is NOT an elementary one).
No wonder you had a hard time trying to solve your problem.

That's what the help says. But, maybe somebody knows a way to do it. I will recheck the anwers posted to this problem. Maybe I will learn something new.

ValRo


Posted by Chris Heinrichs on 7 July, 2004 - 11:46 am
Jim Thorpe - which version of S7 are you using? In a later version (5.2 SP1) if you highlight the SFC20 BLKMOV instruction then it gives a list of things you CAN'T copy, one of which is the peripheral area. It does not say you cannot write to these areas using the instruction, but I think you are learning that the hard way. The brute force method is to use a series of MOVEs from your source to the PQ area.

This essentially how SFC20 realizes itself at the machine level anyway, a series of moves. Keep in mind the time requirement of writing to the peripheral area. Look in the S7 300 instruction document to find how much time it takes for your processor. Also be sure that you are not writing to peripheral outputs that will be updated by the output image table at the end of the OB1 cycle. If you do, you need make sure the Q's are updated too. For example, with:

L MD 1000
T PQD 20

if QW 20 doesn't match MD1000, you will see unexpected results at your output after the end of the OB1 cycle.

luck
cph


Posted by Lowiek on 7 July, 2004 - 11:45 am
Hi,
I think you have to use SFC14/15 if you are using 3 byte or more then 4 byte at once. SFC14 and SFC15 are to read/write consistent data to I/O.

Best regards,
Lowiek


Posted by soren holm on 7 July, 2004 - 1:59 pm
Not sure if I understand your question, but I think the answer is, u can not

Using SFC 20 "BLKMOV" you can copy all memory areas except:

The following block types: FB, SFB, FC, SFC, OB, SDB,

Counters,

Timers,

Memory areas of the peripheral I/O areas.

regards
soeren


Posted by Dennis Patterson on 7 July, 2004 - 5:01 pm

here's an example:


CALL "BLKMOV"
SRCBLK :=P#DB5.DBX32.0 BYTE 32
RET_VAL:=#rubbish
DSTBLK :=P#Q 8.0 BYTE 32
NOP 0

here i am moving 32 bytes to the output image starting at q8.0.

Hope this helps<br>
dennis



Posted by river70 on 7 July, 2004 - 5:13 pm
STEP 7 stores the parameter type ANY in 10 bytes. When constructing a parameter of the type ANY, you must ensure that all 10 bytes are occupied because the called block evaluates the whole contents of the parameter. If, for example, you specify a DB number in byte 4, you must also explicitly specify the memory area in byte 6.

STEP 7 manages the data of elementary and complex data types differently from the data for parameter types.

ANY Format for Data Types

For elementary and complex data types STEP 7 stores the following data:

Data types

Repetition factor

DB number

Memory area in which the information is stored

Start address of the data

The repetition factor identifies a quantity of the indicated data type to be transferred by the parameter type ANY. This means you can specify a data area and also use arrays and structures in conjunction with the parameter type ANY. STEP 7 identifies arrays and structures as a number (with the help of the repetition factor) of data types. If, for example, 10 words are to be transferred, the value 10 must be entered for the repetition factor and the value 04 must be entered for the data type.

The address is stored in the format Byte.Bit where the byte address is stored in bits 0 to 2 of byte 7, in bits 0 to 7 of byte 8, and in bits 3 to 7 of byte 9. The bit address is stored in bits 0 to 2 of byte 9.

With a null pointer of the type NIL all bytes from byte 1 are assigned 0.

More information could be found in Step7 online help.

Rgds


Posted by Luc Willems on 8 July, 2004 - 1:37 pm
search in the html help for anypointer there is a very usefull example. other wise mail me.

luc..willems@elwe-automation.nl


Posted by Fontardion on 8 July, 2004 - 1:38 pm
Dear Sir,
You can't move an UDT because UDT is a description of a data formar inside STEP7, but you can't transfer it to the PLC.

If you want to copy the data in the UDT, you must pointer then with the type of P#DB1.DBX10.0 BYTE 10.

Sincerely,
Fontardion


Posted by gubenko on 20 February, 2011 - 9:02 am
-use write perefery [preferably?] SFC15 : you need to put physical address, length of Source and Source itself. its were you have your UDT for example.
good luck

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2014 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
As the poet said, "Only God can make a tree" -- probably because it's
so hard to figure out how to get the bark on.
-- Woody Allen
Advertise here
Advertisement
our advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive