I guess my confusion comes in when it comes to setting up the actual instruction. Never worked with arrays in studio 5000 so trying to find the best youtube videos of actually setting up the logic.
I guess my confusion comes in when it comes to setting up the actual instruction. Never worked with arrays in studio 5000 so trying to find the best youtube videos of actually setting up the logic.
The forum starred out the name K***** Automation even in the links
If you copy the link and paste it in Firefox it will show
Since the 3 colors have unique values other than 0 just use one array shifted.
When the right value for that ejector is in the right place eject and 0 the value, if it's the wrong value let it pass without ejecting.
I think a simple EQU 1 Array[correct position]
Logically, how would that look? The idea makes sense I am just having a difficult time transferring that to ladder logic.
In this example the Lego at the Orange photoeye is Tan & will pass
and the Lego approaching the Black photoeye is Black and will latch
the Eject_Black tag and zero out the array entry as soon as the photoeye is made.
Then use the latched tag to run your eject cycle and unlatch it.
EDT: Make the rung comment "Black Ejector" not "detector"
Color_Seen is a DINT array, that I made 12 DINT's long but can be whatever length is needed. Color_Seen[4] will change its value every shift to represent the next block that came through, or 0 if it shifted without a Lego present.
The color sensor when it detects a color puts that value in Color_Seen[0], then the array is shifted up. Thus Color_Seen[3] was the block detected 3 shifts ago, which I figure is at the orange ejector, but in actuality it might be from Color_Seen[2] to Color_Seen[6] depending on the layout of the conveyor and control of the shifting
Bonus question: How much money has the guy that invented the blocks made in all these years? HINT = $0.00 because the founder of Lego stole his idea and the inventor lost in court.
So I was able to get value into an array but shifting it is where Iām having my issue now.
And I understand shifting a bit through but how does one shift a DINT through an array?
This for sure cleared things up for me. Are Color_Seen[3] and Color_Seen[4] always assigned to Orange (1) and Black (2)? Or are the color values of 1 and 2 moving through an array similar to a BSL?