Cognex 300 series Dataman BC scanner Logix

Sean Teague

Member
Join Date
Apr 2020
Location
Tennessee
Posts
69
Hey guys,

I have an older Cognex Dataman scanner that i have added to a machine. I have established comms over ethernet. I am able to trigger manually and receive data from the scanner. So heres my problem:

My barcode is the current date.

Im getting the data back from the scanner into these locations

COGNEX:I.ResultData[0] '0'
COGNEX:I.ResultData[1] '2'
COGNEX:I.ResultData[2] '0'
COGNEX:I.ResultData[3] '8'

then im comparing it to the current date in the PLC.

If this data compares correctly im setting an output BARCODE_MATCH

im having trouble "clearing" COGNEX:I.ResultData[0], COGNEX:I.ResultData[1], COGNEX:I.ResultData[2], COGNEX:I.ResultData[3] later in the logic. I have tried to MOVE a "0" into these locations but once i stop movng the "0" into those locations, they automatically populate with the data from the last scan...Im trying to basically clear out the memory to be ready for the next scan....
 
Do you have a tag called COGNEX:I.Status.ResultID? If yes, use this to determine when a new scan comes in. One way is if ResultID NEQ ResultIDStored then MOV ResultID to ResultIDStored and OTE TriggerBit. I have never bothered to clear results between scans, just use a one scan trigger when a new scan comes in.
 
Yes, i do have COGNEX:I.Status.ResultID, but not ResultIDStored

Would you happen to have any sample logic of this? I am not a very experienced programmer and i am having trouble understanding this.
 
That's my version of pseudo-code. ResultID increments every result, so when it changes you know a new scan came in. Create your own tag for ResultIDStored of the same datatype as ResultID. I don't recall if it's INT, DINT, or something else. TriggerBit represents whatever BOOL tag you create to trigger the action to compare dates or whatever you want to do. I could probably find a screenshot later. What controller are you using?

Edit: a bit more clarification before I head out for errands- since ResultID changes every result, a common way to detect the change is to compare it to a stored value. If the ID doesn’t equal the stored value, then output a trigger bit and store the value. The next scan the ID will equal the stored value and the trigger will turn off. This creates a trigger true for a single scan of the program. There’s other nuances if you’re using periodic tasks that occur at different intervals then a different task might not see the trigger, but within one program, that’s a common method. My terminology here is mostly Rockwell but generally applies to others.
 
Last edited:
At some point it will roll over, maybe to zero, maybe to the negative extent of the data type. If you only need to detect when the value changes, as long as you use the same data type (INT, UINT, DINT, etc.) to store the value, it’ll work.
 
That looks to me like it could work. We haven’t used the ResultsAvailable bit, so I don’t know what that will do for you.

Know that as written, BARCODE_MATCH will be on for a single scan. Depending on what you do from there, you might need to latch that or something else on then unlatch after some action completes.
 

Similar Topics

We finally replaced our Cognex Checker with an IV-3 and I'm wondering if can replace the s/w in the monitor with anything else. I haven't been...
Replies
0
Views
104
Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
135
Which signals do I have to use to get data from camera. For example camera detects a defect and sends signal to controller. Power cable: CCB-PWRIO-05
Replies
1
Views
220
Good People of PLCTALK. I am trying to understand the pass-fail on one of our product lines. I was able to record the Cognex images on the...
Replies
2
Views
239
Gents, We have the following configuration: A Beckhoff PLC with EthercatMaster > EK1100 with a EL6652 EthernetIP Master. Plan is to...
Replies
2
Views
391
Back
Top Bottom