4/1/2013 10:38 AM | |
Posts: 15 Rating: (0) |
Hi Experts, I have S7-400 system with Panel PC 677. My problem is there are two bits in a DB which are "set" and i am unbale to reset them even through VAT and i am unable to find these bits in PLC program. I reset PLC memory completely but same issue. Is there some other way to reset these bits? If these bits are forced in program can we overwrite? DB is of ARRAY type and two bits are DB74.DBX95.0 and DB74.DBX95.1 I have attached PLC program for reference. Looking forward for usual support. Thanks & Regards, Mohsin AttachmentGdx2_dresden_withA400.zip (32 Downloads) |
Last edited by: O_Moderator at: 4/4/2013 2:57 PM |
|
4/1/2013 2:00 PM | |
Joined: 10/7/2005 Last visit: 5/23/2024 Posts: 3007 Rating: (1049)
|
Hello Mohsin_6334 there's a fair bit of indirect addressing going on in your S7 program and the fact that your backup has no comments nor symbols doesn't help with the analysis. Having said that, FC120 seems to be the one driving bits in DB74 and it is called conditionally numerous times throughout the program. Being a conditional"CC" type call. FC120 can not have parameters and the bit address is passed on to it via accu1 (which is rather suboptimal programming and also fraught with danger). I suggest you search for theFC120 calls where the values 760 (= 95bytes * 8 bits per byte + 0 bits = 760) and 761 (=address 95.1) are loaded into accu1 right before the CC call of FC120 and you may find out what conditions drives these bits to be set by FC120. Ideally though, you get hold of a documented offline program to make your life a bit easier. I hope this helps |
Last edited by: fritz at: 4/4/2013 12:41 AMchanged "fraud" to "fraught", thanks SteveA Cheers |
|
4/3/2013 5:56 AM | |
Joined: 10/7/2005 Last visit: 5/23/2024 Posts: 3007 Rating: (1049)
|
Hello Mohsin_6334 let me put it this way: The only reason I can see that they used a CC call of FC120 and "abused" accu1 to pass over a value to the FC120 call is because they could do it (not because there was no better or neater way). Sometimes people program in a certain "clever" way not onlybecause they can, but soemtimes people don't know any betteror simply aim at making their code less understandable for the uninitiated. FC's and FB's are designed to have parameters and it would be far more sensible and the code easier to understand if these would have been used. Granted, in your case the code will work without problems (well at least the typcial FC120 CC calls that I looked at), but I'd still say it"suboptimal and fraught with danger" because you need to be mindful of the pitfalls assocciated with this type programming style. Anyhow, have a look the FAQ In which operations does STEP 7 overwrite ACCU or register contents? as well the Step 7 inbuilt help topics of "Notes on changing the contents of registers" and "Avoiding errors when calling blocks". Bottom line: In an ideal S7 programming world you do NOT usethe RLO or accumulator 1 or 2 as implicit parametersfor an FC or FB call. |
Last edited by: fritz at: 4/4/2013 12:40 AMchanged "fraud" to "fraught", thanks SteveA Cheers |
|
This contribution was helpful to1 thankful Users |
Follow us on