Jump to content

Recommended Posts

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,

  1. How do I get the barcode scanner to save the taught code
  2. I know how to compare when this is done
  3. On a bad read I will set a bit to have a value of 1
  4. On a good read I sill set it to be 0
  5. 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

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

  • 2 weeks later...
  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.