08-31-2019 12:42 AM
Color separation machine i receive color spectrum and instructs the servo motor to rotate but the problems is how can i count one and i try to use elapse time but don't work. help me please ( sorry for my English)
08-31-2019 01:16 AM
@TinyfromThailand wrote:
( sorry for my English)
Our Language is LabVIEW. We understand diagrams, but it is much more difficult to help of you attach incomplete picture fragments. Please attach the VI and explain what you want to count. I assume you want to count to more than just 1.
08-31-2019 08:32 AM - edited 08-31-2019 08:34 AM
@altenbach Example = When a red object pass the camera then start to count 1 for red object only. After that when a red object pass the camera again then plus 1 therefore total is 2 and again again. And green blue yellow violet. I try to use elapse time (red object stay at the camera about 1 second) but non-stop counting i don't know why. I hope you understand what i want. Thank you very much.
08-31-2019 09:21 AM - edited 08-31-2019 09:22 AM
Hi Tiny,
cleanup your VI and remove Rube-Goldberg constructs:
(I left just the core functions, don't have LINX/IMAQ installed.)
You can even place those boolean indicators into a cluster and use ArrayToCluster after BuildArray to further reduce block diagram clutter…
08-31-2019 11:58 AM
@GerdW wrote:
You can even place those boolean indicators into a cluster and use ArrayToCluster after BuildArray to further reduce block diagram clutter…
Exactly! And if you make the cluster container transparent, the front panel would look exactly the same, but with 5x less clutter on the diagram. Instead if indexing out the elements and re-building the array, You can even do all in one step. I16 is awfully limiting for a computer count. I would recommend at least I32. I am not sure if only exactly one LED can be true at the same time, so I question the code part with "search array". I am not familiar with the missing IMAQ function, but if you really only want the most dominant color, an "array max" might do the trick and the max-index would point to the count to be incremented.
It might be more accurate to count only the FALSE>>>TRUE transitions to ensure not to count a slow object twice. (not shown, but this would only require small changes to the code)