It's late, and I'm tired, but here is a bit of code I used 3 years ago, on a CQM1.
If you reply back with questions I will try to help.
RT
LD HR19.01
XFER(70) #10 DM6200 CURRENT_PROD
LD HR19.02
XFER(70) #10 DM6210 CURRENT_PROD
LD HR19.03
XFER(70) #10 DM6220 CURRENT_PROD
LD HR19.04
XFER(70) #10 DM6230 CURRENT_PROD
' When the scanner is triggered and reads a code, the CQM will read data until it sees CR/LF, then turns on AR8.14.\nWe then RXD that data (AR810 = num of bytes in buffer) into D100
LD DATA_RDY
OR 222.02
@RXD(47) DM100 #1000 AR10
SET 140.05
' Compare the scanned data with the saved product data. \nMCMP puts a 0 in each bit of CIO141 where the words in D100 and D120 match.\nOnly the first 6 bytes (3 words) will match, so bits 0,1,2 should be 0
LD 140.05
MCMP(19) DM100 CURRENT_PROD 141
' because we are only looking at the first 3 words, mask out the high 12 bits (AND #F).\nWe could have done AND #7 and compare with #0.
LD 140.05
OR AlwyON
ANDW(34) 141 #F 142
LD 140.05
ANDNOT 145.00
CMP(20) 142 #8
AND P_EQ
SET 145.00
RSET 140.05
LD 140.05
AND 145.00
CMP(20) 142 #8
AND P_EQ
SET 145.01
RSET 140.05
' Display the digit 1,2, or 0 on the ScanRequest screens, to show the operator if the scan(s) was successful
LD 145.00
@MOV(21) #1 DM300
LD 145.01
OR 146.00
@MOV(21) #2 DM300
LDNOT 145.00
ANDNOT 145.01
ANDNOT 146.00
MOV(21) #0 DM300
' If the passcode was accepted, and the Bin counter is reset, then wipe out the entered passcode
LD 146.00
ANDNOT FULL
MOV(21) #0 DM350