DaveE Posted October 31, 2013 Report Share Posted October 31, 2013 Good Evening all I was looking for a little help!, isnt that why most of us here? I need to use a PLC, obviously it will be a Unitronics to connect a Microscan bar code reader and do the following Scan a code that I will use as a master, save this scan result into a register somewhere.(Teach) Then when a photo eye is triggered scan another code, and compare it to the taught code. If the result of this is good, I want to set an good read out put If it is bad I want to trigger an bad read output Now for the kicker, or 3 ! The barcode could be up to 55 characters long and is variable in content The reject for the bad read barcode could be several feet from the actual scanner, and there will be boxes between the reject and the scanner. The reject will have a separate photo eye input. I know that I will need a shift register to be able to do a FIFO (well I think I do) So my question is, How do I get the barcode scanner to save the taught code I know how to compare when this is done On a bad read I will set a bit to have a value of 1 On a good read I sill set it to be 0 How do I create a FIFO? Especially one where I will need to set the number of registers on the fly as it may vary from unit to unit! I will be connecting the scanner either by RS232 or Ethernet, depending on the line again, is it possible to have one program that can do either? Thanks Link to comment Share on other sites More sharing options...
Alexander Posted November 1, 2013 Report Share Posted November 1, 2013 This should all be possible through using the Function Block Protocol Scan function in conjunction with our Data Tables. Since the barcode can be up to 55 characters and variable in length you will need a way for the PLC to detect that the message has ended. Within the protocol scan function you can utilize a silence option in miliseconds to detect that the message has ended. The information that is read will be stored in the message buffer and can be copied to a data table. Using the data table will allow you to easily configure a FIFO system. Each time the data is written to row, you can perform a data tables copy row function to shift all of the rows except the last down by 1. The data table can have as many rows as necessary depending upon how much historical information you wish to save. When the photo eye is triggered and another barcode is read you can store this information to a vector for comparison purposes instead of the data table which is for "learned" information only. To compare the two you can perform a Data Table search and compare the newly stored vector against all of the rows in the data table. If the information is matched then it will output the row number that it was found on. If not than it will return a -1. Using these values you can use comparison functions to set or reset the good and bad bits. You can utilize both the Serial and Ethernet options within one program. Only one scanner can be used per port, but there are separate functions for Serial Protocol and IP Protocol so it is possible to have a program that utilizes both. We have a very helpful webinar on using our Function Block Protocol: http://www.youtube.com/watch?v=6jpuKTxXznw Also helpful might be our webinars that cover Data Tables. Link to comment Share on other sites More sharing options...
DaveE Posted November 10, 2013 Author Report Share Posted November 10, 2013 Alexander Thanks for the reply The function block video was really helpful And I am working my way through data tables..still trying to work out them,especially how to make the reject point variable Will work through it Link to comment Share on other sites More sharing options...
Orpsys Posted June 25, 2016 Report Share Posted June 25, 2016 Hi dave I know this is an old thread but I am wondering how it worked out in the end. Were you able to get the system working and did you use ethernet Link to comment Share on other sites More sharing options...
DaveE Posted June 29, 2016 Author Report Share Posted June 29, 2016 Orpsys You are right, this is an old thread, took me a while to remember this one Yes I got it working in serial and ethernet and used data tables for the Fifo Dave 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