I am going to back off, somewhat, from this statement and recommendation. According the the Horner Automation video, when the RECV instruction's input rung is False, that clears the internal serial buffer.
So when PART_POS1 goes from 0 to one, the RECV will have an empty buffer. That being the case, as long as that happens before the barcode scanner starts sending serial data, and if the scan is a complete 29-character (28+carriage return) read, then the %R01000 buffer should contain a full barcode scan and the RECV will complete and the rest of the logic should be okay.
However, if there is a short or long scan, I am not sure the current code will alwyas trigger the red light. That said, with the [NO Contact PART_POS1], the read and system will be reset for the following part.
i'm baaa'ack...
So, I've assembled and wired my second assembly and i'm back to the logic. I've made the changes to the code you last posted.
As of now, i put a part in, barcode scans, goes green, cyl retracts, part leaves Part_pos1 and the light goes off and cylinder extends. Neither of those should happen until Part_pos2 is made.
I've tried a couple changes and still can't seem to wrap my head around what to change to get those in the order i want.
(plus i still think they want to be able to scan the next part, even if the first part has not left Part_pos2 yet)
Attachments
Last edited: