7/27/2012 2:10 PM | |
Posts: 35 Rating:
|
Hi. I made a program in Simatic Manager that is supposed to determine the position of a motor by means of an encoder. The program works fine by itself but when i add another function in the program that is used for something else, the function for the encoder stops working properly, it doesn't make the counter go up or down. So far the only way i found to eliminate the interference was to remove the call to the second function in the OB but this way the second function is useless and i need it.I have uploaded the project so if you could take a look at it and give me some feedback I would be very grateful.
AttachmentEnkoderS.zip (200 Downloads) |
7/28/2012 6:56 AM | |
Joined: 10/7/2005 Last visit: 9/14/2025 Posts: 3049 Rating:
|
Hello IvoIvic your problem is caused by a misunderstanding of how M memory is organised and addressed in an S7 as you use M1.x and M2.x as bits in FC1 and then use the same memory in form of MD1, MD2 and MD3 in FC 2. As MD 1 containsall bits fromM1.0 up to M4.7, FC2 will overwrite thesebits which causes your problem. Moreover,if you use for example MD1, the next free MD would be MD5, i..e you can not use MD2 or MD3 as you have done in FC2. To find out what M bits, Bytes, Words or Doublewordsyou have used and where overlaps exist, open theCross reference list from the Options menu and display the Assignment of in/outputs,bit memory, timers and counters. I hope this helps |
Cheers |
|
This contribution was helpful to
1 thankful Users |
Follow us on