8/28/2009 4:10 PM | |
Joined: 9/25/2008 Last visit: 10/21/2021 Posts: 8 Rating: (0) |
Dear Forum: I am trying to develop a simple library to control many motors (more than 20) from a CPU224; Te point is to have a prolix program, so I`m including all the meaning bits of each motor on a subroutine in order to create a LIB: Start, Stop, Protection; as inputs (Please see the attached program as example) It works just fine with a single motor but a problem appears when using more than one block; When I (HI) the star bit of the first block both motors (Q0.0 and Q0.1 on the example) Is there any other option to create this kind of subroutines without affecting more than one bit at once? Please give me a hand on itAttachmentMotor_Blok.zip (52 Downloads) |
8/31/2009 1:30 PM | |
Joined: 5/28/2008 Last visit: 4/24/2024 Posts: 1343 Rating: (141) |
Hi, I think it's like Arunakat1 said. Local (temporary) memory you should only use during one call of one block. If you set in first block a local bit, its also set in the second block during the same cycle. In next cycle its undefined. So you can use local memory e.g. for some calculations during one cycle. But never to set outputs. What you can do is creating a library. Please have a look here: [url]http://support.automation.siemens.com/WW/view/en/16511756[/url] But you should use global memory (V). So for each block you will call in your program another global memory will be used. regards |