6/3/2011 1:32 PM | |
Posts: 270 Rating: (53) |
Well, if you put it there, it should be ok. And yes. What I ment, though, is that your data blocks have default length after you did create them. Open DB8 and DB9 from your Simatic Manager the way you open OBs and FCs, etc., and set them proper length and then if you switch to data view, you can set there the 144/180 values also. What is good too, when you run your program, open the online DBs and check the values that are in, if they fit and stuff, just to see if things work.
I think that is the point of DBs, to store the values "permanently".
If you look at the attached picture (from help on FC84 ATT again), you will see that the required parameter is a pointer. So it shouldn't even let you call just DB8. Also, if you would somehow point on the DB but not specify where, then I asume it would take it at the start of DB (DBW0), which might contain anything (idk if you use it for something), as you start your values from DBW10.
Yes, I believe you can do this. I am not sure, though, if it doesn't open the data block (in case you had opened some other and would want to use it later). Either way, you can use OPN DB8 and then L DBW12(10) and it will open the DB8 and then load the word at 12th(10th) byte from currently opened DB.
It seems you got a bit confused here, which is no surprise, it could get pretty confusing. Anyway, I believe this answers the previous answer. I suggest you, when you are done with this and get some time, have a deeper look on stuff regarding addressing and pointers. It makes one wonder sometimes so just give it some time to "suck in" the concept into your brain. You can use for example this document to get better understanding of things (http://support.automation.siemens.com/WW/view/en/45531551), best would probably be, when you have time, to start from beginning and go through it page by page. |
Last edited by: MM1234 at: 6/3/2011 1:32 PMforgot the attachement... .]] |
|
6/3/2011 3:06 PM | |
Posts: 270 Rating: (53) |
Check that second attachement, there is example how your DB8 will look. Maybe I expressed it in not understandable way, but anyway it's not 5 elements total before the 144, but 5 elements before the two values for how many total and how many current elements you have and THEN the 144 elements. So, it's actualy not 6, but 7. You did the mistake everyone does and forgot about DBW0, that's why I stressed that it starts counting from 0. .) So check my previous attachement and I think it will be clear (/tf/WW/en/postattachments/download?attachmentId=20366&onlyInternet=False). As for the:
Read what I wrote before, check carefuly the examples and it should be clear how to initialize the value of a certain element in the DB. |
6/3/2011 3:29 PM | |
Posts: 30 Rating: (0) |
Oh yeah I see, that's actualy pretty easy! I put my hole program in attachment if you might be interested :-) Thanks again MM1234, I made a deal so I have a step7 even tomorrow, I only have to do the symbol table and some little changes so I guess I'll be done tomorrow. Thanks all! Kind regards, Matthias V AttachmentMilieuANYLANG.zip (198 Downloads) |
This contribution was helpful to3 thankful Users |
Follow us on