Jump to content

Recommended Posts

Posted

I'm working on a scanning project that scans barcodes of 2 parts during assembly to compare them. I'm using 1 scanner connected to the serial port. I need the operator to scan the  first  barcode, then he should be prompted to scan second barcode, then compare the 2 strings. I need help on how to prompt to second scanning after handling and saving the first input. Should I just fill the buffer with 000 then put a rung to receive data through the port again? 

  • MVP 2023
Posted

You can scan barcode by Protocol FB.  Scanned barcode is replaced by another one in buffer if you try to scan another barcode.

 

There is several options in this process:

1) Barcode 1 = Barcode 2. User can scan barcode 1 (or barcode 2) two times and it is wrong solution.

2) Barcode 1 not equal Barcode 2 but these two barcodes is an assembly unit - you can scan it and find a row in DTI where another one barcode is present.

3) Use two barcode scanner with different positions (stationary) connected to different com ports. Parts scanned if it fit correctly.

4) Barcode 1 + Barcode2 = constant. Scan barcode1 add to SUM tag, scan barcode 2 add to SUM tag and compare with CORRECT SUM tag. Reset SUM.

5) Generate different  sound for different barcode (zebra motorola  barcode scanner has this option embedded into firmware).

 

I  implemented  barcode scanner for wire harness checking device.

The main problem - user scan barcode - check wire harness ---OK.  Then user scan barcode for another one  but did not check another wire. The first OK wire harness is checked many times.

In system log all wire is checked but it is not correct.

After all  we used hardware for marking good wire harness and if marking is present - user cannot check one wire  many times.

This problem is the main in your system. User can scan correct part many times and use wrong one in assembly. 

 

 

  • 2 weeks later...
Posted

I'm already using 2 scanners connected to 2 different Serial COM ports. but currently they only scan once with both scanners and then I compare the 2 barcodes. But  I also want to scan 2 other parts with the same scanners and also compare them. So my question is, can I just copy and paste the rungs I'm already using to treat additional barcodes? Will it automatically prompt the cursor to take in other barcodes after each scan? What if I want to move to the next barcodes only when the ones just scanned are good? 

I'm attaching my code to show what I'm talking about.

UniStream_070_Message_Composer_Two Barcode Readers.ulpr

  • MVP 2023
Posted

Your COM Rx blocks are on the rail and therefore always live and looking for data from the associated port.  Do not just copy and paste them, as if there are two COM Rx blocks looking at the same port at the same time they will crash into each other.

Instead, create a sequence that looks at the port, and when data comes in move it to another string variable you can use for comparison like you are doing in rung 2 (all the time).  

8 hours ago, Bertrand Irakoze said:

What if I want to move to the next barcodes only when the ones just scanned are good? 

This is what your sequence will do.  You'll have to make your program decide.

If you can be very specific about what rules you want to follow and in what order we can help.

Joe T.  

  • Like 1
Posted

Thanks for that Joe! you put it very well. It makes sense now.  As long as my COM Rx blocks are live, every new data I get I can copy it to another string variable. Can I use the same buffer tags to write data to from the ports they are looking at. Since I reset them after each successful comparison. But let me be specific about my rules. 

First scan, In one port, I I look at the string for its last digit, if it is L (for Left), that's good. Same thing for the other port, on the first scan, I look for R( for Right) as the last digit of the string. Only when that's good, I take in another string on the subsequent scan.

For these new strings, I do the same and look for the last characters ( L and R), but also compare the first part of the string that comprises of numbers. If they match then I'm good to go. I already got the code working for this second set of comparisons. I wanted to add another sequence for the new scan.

Thanks,

Bertrand Irakoze 

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.