10/6/2018 10:52 PM | |
Joined: 2/19/2017 Last visit: 11/20/2022 Posts: 8 Rating: (0) |
Dear All, I have to shift 1500 bits 1 by 1. I have a trigger sensor and I have 800 pulse encoder. The encoder sifts the bits 1 by 1. So How can ı Shift 1500 bits one by one. Further information. I will use this in a bottle conveyor automation. For example the bottle will be ejected in 1306 bit. Please can you help me for this problem. Best Regards ------------------------------------------------------------------------------------------ |
Last edited by: elektronik67 at: 10/6/2018 10:52:51 PMLast edited by: The Helping Hand at: 10/8/2018 9:50:33 AMNew subject after splitting |
|
10/7/2018 6:10 PM | |
Posts: 2826 Rating: (684) |
Hello.
See the attached for one example. This is not a typical shift register. It uses an array of bits. Typical usage of the attached code:
Internal to the code segment is a constant that determines how many data elements are stored. This can be adapted as required. The code can also be change to handle other data types instead of handling bits. --------------------------------------- Having a shift register function of this kind is not the only solution. The encoder position can be recorded into a table (array) each time the sensor triggers. The task is executed when the travel distance + recorded value is moved. BR AttachmentBitShift.zip (164 Downloads) |
10/8/2018 3:49 PM | |
Joined: 2/11/2015 Last visit: 6/3/2024 Posts: 441 Rating: (33) |
Hi elektronik67, Pay attention, the array starts on 1 or 0 ?¿ |