Sean Teague
Member
I have installed a Cognex barcode scanner on a machine. I have a 1769-L18ER CompactLogix processor.
I have communication setup and working.
I have the 4 digits from my barcode scan coming into the PLC as SINT into:
COGNEX:I.ResultData[0] = 1
COGNEX:I.ResultData[1] = 0
COGNEX:I.ResultData[2] = 2
COGNEX:I.ResultData[3] = 5
So my barcode read is "1025" which is correct. The barcode is the current date. (Month and Year)
I want to compare this to two STRING files already in the PLC...
Print.ST16[30] = 10 (current month)
Print.ST16[31] = 25 (current date)
Im having trouble figuring out how to compare this data.. Basically I need to combine COGNEX:I.ResultData[0] and COGNEX:I.ResultData[1] to get my month and COGNEX:I.ResultData[2] and COGNEX:I.ResultData[3] to get my date, then compare each of those to the existing Print.ST16[30] and Print.ST16[31]
any help would be greatly appreciated. I hope i explained it well enough
I have communication setup and working.
I have the 4 digits from my barcode scan coming into the PLC as SINT into:
COGNEX:I.ResultData[0] = 1
COGNEX:I.ResultData[1] = 0
COGNEX:I.ResultData[2] = 2
COGNEX:I.ResultData[3] = 5
So my barcode read is "1025" which is correct. The barcode is the current date. (Month and Year)
I want to compare this to two STRING files already in the PLC...
Print.ST16[30] = 10 (current month)
Print.ST16[31] = 25 (current date)
Im having trouble figuring out how to compare this data.. Basically I need to combine COGNEX:I.ResultData[0] and COGNEX:I.ResultData[1] to get my month and COGNEX:I.ResultData[2] and COGNEX:I.ResultData[3] to get my date, then compare each of those to the existing Print.ST16[30] and Print.ST16[31]
any help would be greatly appreciated. I hope i explained it well enough