resonanceshah
Member
Hi guys,
I have a problem related to the Siemens S7-200 PLC. To be able to perform a particular position control for 2 separate motors, I decided to develop a library for the same. I developed a program (for position control) purely with local variables and specified each variable as an IN, OUT or a TEMP. I created 2 subroutines (say A & B) within 1 program (say XYZ) and created a library.
Now I open the main project where i intend using this library. So I add library XYZ and use A & B sub-libraries within for position control of 2 motors.
The problem is that both the motors run perfect individually . But the minute i decide to run both together, the motors start behaving erractically. Their sequence seems to make no sense at all and i get a feeling that somehow the local variables (used within the library) are getting random values. This makes me think whether I am missing out on something about how the S7-200 accesses local memory.
Also, the library has been created such that no local memory value is assumed when the library is entered. Every time the library is accessed by main program, based on the Inputs assigned to library, the outputs will be generated.
My understanding of the local memory access is as follows.
- Every subroutine created will have 60 bytes of local memory allocated to it.
- There is no guarantee of the value in the local memory once I am out of the routine.
- No routine can access local memory of another routine.
I would really appreciate help of any kind.
Thanks
I have a problem related to the Siemens S7-200 PLC. To be able to perform a particular position control for 2 separate motors, I decided to develop a library for the same. I developed a program (for position control) purely with local variables and specified each variable as an IN, OUT or a TEMP. I created 2 subroutines (say A & B) within 1 program (say XYZ) and created a library.
Now I open the main project where i intend using this library. So I add library XYZ and use A & B sub-libraries within for position control of 2 motors.
The problem is that both the motors run perfect individually . But the minute i decide to run both together, the motors start behaving erractically. Their sequence seems to make no sense at all and i get a feeling that somehow the local variables (used within the library) are getting random values. This makes me think whether I am missing out on something about how the S7-200 accesses local memory.
Also, the library has been created such that no local memory value is assumed when the library is entered. Every time the library is accessed by main program, based on the Inputs assigned to library, the outputs will be generated.
My understanding of the local memory access is as follows.
- Every subroutine created will have 60 bytes of local memory allocated to it.
- There is no guarantee of the value in the local memory once I am out of the routine.
- No routine can access local memory of another routine.
I would really appreciate help of any kind.
Thanks