11/13/2014 7:42 PM | |
Posts: 23 Rating: (0) |
Hello again! I’ve got a question about a problem with a written program. First of all i'm still learning real hard with programming, stil have to lear so much! So every tip is welcome!! I’ve written a program to sort products, every product needs to go to a different output of the conveyor system. Every product has a position, this position is measured by a encoder. But this position in the software could defer with the real position on the conveyor(the product has a little delay or something) so I want to correct this for example every 10m with a sensor. The position of the sensor is always the same so when I detect a product I could update this position with the position of the sensor. I made a FB of the code that corrects the product(And it works, for one sensor!) In this FB I made some other FB(instance, so it will saves the data of this sub FB in the bigger FB) like, find product, update product and check size. ( for information: when a positive edge of the sensor is detected the program seach for data, no data and detection longer than (for example: 50mm there is an error, if there is a detection and data the position is updatet, and if there is data but no detection i have also an error.) BUT, when I insert this FB multiple times in main it will not update the position any more(collision between the FB I think) So I checked if I’m using globals, but I’m not.(Only the Product DB where all the active products are) I checked if the Db’s of the Check_Product FB are different, and they are. Then I thought I could be that the FB’s are updating the product on the same time, but that is impossible because they are only updating when the specific sensor is high(I simulated the sensor with a button, and gave this as a parameter to the FB) and I’m only pressing one button. Has anyone had this problem before or could someone think of something what I’m properly missing. Ps because i'm still a new to "real" programming and my rubbish English I added printscreens of the FB as an attachment. I hope some one know's the solution or could gve me some pointers!!! thanks in advance! AttachmentFB_Check_Product.pdf (223 Downloads) |
Follow us on