No announcement yet.

Productivity 2000 and Datalogic Matrix 450 over Ethernet/IP

  • Filter
  • Time
  • Show
Clear All
new posts

  • Productivity 2000 and Datalogic Matrix 450 over Ethernet/IP

    New to the forums, and new to programming for Ethernet/IP and really struggling with this..

    I've been looking through videos and semi understand the relationship to class/instance/attributes in respect to Ethernet/IP, but really fighting with getting the correct sequence of events to retrieve a scan from a barcode scanner to my PLC.. I've it talking and can send queries to the scanner and receive resposes such as vendor ID and ethernet address and such, so I know I have connectivity. Can anyone point me in the right direction to retrieve the last scanned barcode number from the device? I tried following the instructions for the Do-More in the video and it helped but it's stage programming and doesn't translate well to the P2k..

    One problem I'm having is being able to retrieve a data array in string format. It seems the only option I have with the ESMG command is integers..

    Thank you for any insight you call can provide!


  • #2
    Bring the data in as an integer and then use the Copy Character (CPC) instruction to copy into a string.


    • #3
      That makes sense. I didn't wanna do that if I didn't have to but makes sense.

      Any examples of how to read the barcode? I've found how to do it via serial, or with a Do-More PLC, but nothing with a P2k over Ethernet/IP..


      • #4
        No there is not a video for Productivity to a bar code via EtherNet IP. Just set up a scanner device in the hardware config for the bar code scanner and then use unconnected EMSG instructions to read and write data to the bar code scanner You can use tasks in the Productivity to act as the stages in the video.


        • #5
          So far so good, I've managed to pull it in as an array, convert it to a string to read it. But now I need it as a standard integer, not an array, so I can compare it to a normal integer value. Is there a function to go from string to integer (not array) or from array to integer?


          • #6
            You can use the CPD instruction to copy an element of an array to a non-array tag. Are you trying to compare the integer value in the array you receive from the bar code scanner? You can use an element of an Array in the CMP (compare) instruction.


            • #7
              You've been extremely helpful and patient with me. Thank you for that.

              Yes, I'm retrieving a 2 digit bar code number and I'm trying to compare it to an integer element in an array to know what to do with the package. (A sortation conveyor system)

              It looks like, with your help, I've got the info I need to process it. However, now it's back to trouble with the scanner.. I can only read the first barcode scanned after the system is turned on, not the last one.

              My sequence of events are as follows:

              1: A Photo-eye triggers the scanner.
              2: I wait .5 seconds
              3: I issue a EMSG to the scanner: Service 0xE, Class: 0x64, Instance: 0x1, Attribute: 0x9 (Fragment data)
              This loads the scanned data into an array
              4: I confirm that the scan was successful
              5: I issue a EMSG S: 0xE, C: 0x64, A: 0x4, I: 0x1 (Read Item Sequence Number)
              6: I issue a EMSG S: 0x10, C:0x64 A: 0x6 I: 0x1 (Write Last Sequence Number Received back to Scanner)
              7: I issue a EMSG S: 0xE, C: 0x64 A: 0x5 I: 0x1 (Read Fragment Sequence Number)
              8: I issue a EMSG S: 0x10 C: 0x64 A:0x7 I: 0x1 (Write Last Fragment Sequence Number Received back to the Scanner)

              Scanning a second barcode doesn't change the results. It's always the first barcode that is received in the array. This happens until I cycle power on the scanner. Then it will update with the first barcode scanned and remain there until I reset it again.

              I'm sure I'm missing some kind of acknowledgement or buffer flush or something..