Haris Posted August 31, 2020 Report Share Posted August 31, 2020 Hello, I have a vector of MIs starting at MI 250, containing at most 20 elements. It is supposed to act like a FIFO buffer. There is an array of objects moving on a conveyor. Whenever an object triggers a sensor, some integer information is stored at the first available MI in the vector (there is another variable that indicates the number of elements in the vector, not especially relevant to this question). Some time later, when the same object triggers a second sensor, the data at MI250 is to be read, processed, and the vector data is shifted to the left, effectively consuming the first element. I.e. element 1 overwrites element 0, element 2 overwrites element 1, 3 overwrites 2, and so on. Can this be achieved using a Vector: Copy block, as in the attached image? Is it safe to do, am I guaranteed that the copy operation will be executed in the order I mentioned? If this is not a valid way to do what I want to do, please tell me an alternative way. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted August 31, 2020 MVP 2023 Report Share Posted August 31, 2020 If you have any Vision PLC handy, you can test this in about 2 minutes. Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted August 31, 2020 MVP 2023 Report Share Posted August 31, 2020 Yes, it is tested solution. Joe Tauser post this solution in forum topic. I use it for select powder coating gun position when different item is moving on a conveyor and mesuring station is before powder guns. I also manage bit vector copy for ON-OFF gun when no item is placed on conveyor. On this screen you can see illustration of automatic program selection via bit vector copy. Green LED - conveyor sensor, Blue - item sensor. Link to comment Share on other sites More sharing options...
Haris Posted August 31, 2020 Author Report Share Posted August 31, 2020 5 hours ago, Flex727 said: If you have any Vision PLC handy, you can test this in about 2 minutes. Unfortunately, I do not have one at hand :( And even if I did, I would not trust empirical tests like this, since they can succeed based on an undefined behavior. Link to comment Share on other sites More sharing options...
Haris Posted August 31, 2020 Author Report Share Posted August 31, 2020 5 hours ago, kratmel said: Yes, it is tested solution. Joe Tauser post this solution in forum topic. I use it for select powder coating gun position when different item is moving on a conveyor and mesuring station is before powder guns. I also manage bit vector copy for ON-OFF gun when no item is placed on conveyor. On this screen you can see illustration of automatic program selection via bit vector copy. Green LED - conveyor sensor, Blue - item sensor. Alright, thank you for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now