adccommunitymod (AutomationDirect) asked a question.

Barcode scanner: Cognex Dataman 260 to a P2K via Ethernet

Created Date: September 28,2016

Created By: Ridgeline Mach

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I have to communicate between a Cognex Dataman 260 barcode scanner to a P2K via Ethernet. Has anyone done this yet? I am attempting to do it, and am struggling to get it to work. Cognex tech support has me looking at page 29 and 30 of their Communications and Programming manual, to give me the Connection Point/Instance numbers for the input and output, but Cognex cannot give me the Block size, or number of elements. And this is where I'm stumped. Any help someone can provide I'd appreciate. -Todd


  • adccommunitymod (AutomationDirect)

    Created Date: September 28,2016

    Created by: Ridgeline Mach

    I have to communicate between a Cognex Dataman 260 barcode scanner to a P2K via Ethernet. Has anyone done this yet? I am attempting to do it, and am struggling to get it to work. Cognex tech support has me looking at page 29 and 30 of their Communications and Programming manual, to give me the Connection Point/Instance numbers for the input and output, but Cognex cannot give me the Block size, or number of elements. And this is where I'm stumped. Any help someone can provide I'd appreciate.

    -Todd

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 28,2016

    Created by: Ridgeline Mach

    These are the two pages from the Cognex communications and programming manual. So, when I set up the I/O messaging, what should my Data Array size be? Number of elements? Specifically, where, in the new tags created for Data Array, will the Trigger Ready, Trigger Ack, Trigger Enable, Trigger end up? I'll be reading a 10-digit barcode; where will the result of it go?

  • adccommunitymod (AutomationDirect)

    Created Date: October 06,2016

    Created by: Tech_9282

    You should setup a 1D 16 bit array with 13 columns (elements) for the input assemble to the P2K. This is assuming your bar code contains ASCII characters which typically encode 1 per byte. The table in the Cognex manual provides a bit level break down for the flag bits you are asking about. You will need to unpack the first 16 bit array element to access them. Your data should show up in array elements 9 - 13 in integer format which you will need to decode back to ASCII. Be careful you don't decode the data until the right flag bits are on/off so you know the scanner is done processing the barcode and the data in the Result data registers is valid.

    For the output assembly you can probably get away with a single element 16 bit integer array if you only need to the control flags to operate the unit. Then pack your control bits into that element and away you go.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 06,2016

    Created by: Ridgeline Mach

    Thank you Tech_9282, but I'm still lost.

    I found another page in the Cognex communications manual, and it illustrates how to set-up a generic Ethernet module in RS5000 Studio. It shows the assembly instance for input at 11, with a 16-bit array size of 24, and an output instance at 21, with a 16-but array size of 4. When I trigger the camera via the pushbutton on the camera, I see it has scanned properly, based on the Dataman set-up software, and it reads a 10-digit barcode, but I don't see it in the input array of the P2K. In dataview, the input array is all zeros. So, what am I missing? The video on Ethernet IP on the P2K make it sound that with implicit messaging, it just appears without needing any PLC code. With your explanation, that I need to unpack and decode, that sounds like I have to write PLC code. What will that look like?

    Any additional assistance I'd appreciate,

    -Todd

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 11,2016

    Created by: Tech_9282

    Hi Todd,

    Can you post some screens shots of your Ethernet I/P client properties in the P2K as well as the configuration screens from the Dataman software? I am wondering if your implicit connection to the scanner is enabled and online?

    My comment about unpacking/packing is in regards to accessing the bit level information of the status and control words for the barcode reader. You could just use bit level access in the arrays , it will just come down to more of a personal preference at that point. You mentioned using the trigger button on the camera to scan the barcode, i am assuming long term you want to be able to control the acquisition from the PLC? If so you will need to trigger the operation through the control bits provided over Ethernet I/P.

    As for decoding the scanned values, if your barcode contains ASCII characters the barcode scanner will need to encode them into integer format to transmit them over Ethernet I/P as it does not support ASCII natively. So you will need some ladder logic to turn the integer information back into ASCII in the P2K (very simple to do), but lets see if you can get something to show up in that input array before you worry about decoding.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 19,2016

    Created by: Ridgeline Mach

    Sorry, been gone for a week installing equipment. Here's my setup. Thanks for the assistance.

  • adccommunitymod (AutomationDirect)

    Created Date: October 19,2016

    Created by: ADC_CommTeam02

    Looking over the below manual online:

    http://www.hvssystem.com/documentati...rogramming.pdf

    Would like to make a couple of suggestions:

    1.) Change the number of Output elements to 4 integers.

    2.) Change the Config Data connections point to 1.

    3.) Uncheck include status header, this is sometimes not required by a device.

    4.) Are there any errors being updated in the status tags? Noticed not tag was assigned for the Extended Status, can you fill in that tag and any error listed once the I/O message is enabled?

    I have also attached a few screen shots from the manual. Can't confirm 100% if the manual is correct since I do not have the device to connect up to.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 19,2016

    Created by: Ridgeline Mach

    I 've done what you asked, but when I trigger the scanner, I don't see anything. I'm scanning a code of 1234567890. Am I to write some PLC code, too? I'm under the impression that when the scanner reads a barcode, it just "appears " in the dataview at the assigned address. I know it's sending a code to the PLC, as I have the RS232 port configured to Ascii, and have the camera connected there, and it works, but through Ethernet would be better, due to the distance restrictions of serial.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 19,2016

    Created by: ADC_CommTeam02

    Can you provide a screenshot of the Dataview window with the Scanner.MSG1Enable tag enabled that is configured in the I/O message.

  • adccommunitymod (AutomationDirect)

    Created Date: October 19,2016

    Created by: Ridgeline Mach

    Admittedly, I'm too literal. I had to figure out that enabled meant a check-mark under the "edit " column.

10 of 21