adccommunitymod (AutomationDirect) asked a question.

P2000 Ascii to Integer

Created Date: October 12,2015

Created By: befraim

**** 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.****

A Keyence SR-750 barcode reader is sending ASCII numbers via Ethernet/IP to P2000 CPU. How do I convert the ASCII info to integer?


  • adccommunitymod (AutomationDirect)

    Created Date: October 12,2015

    Created by: ADC_CommTeam01

    Use the CPC instruction to copy string to integer array.

  • adccommunitymod (AutomationDirect)

    Created Date: October 12,2015

    Created by: bcarlton

    It is possible that befraim is asking if an instruction similar to STR2INT in the Do-more is available.

  • adccommunitymod (AutomationDirect)

    Created Date: October 13,2015

    Created by: befraim

    Your correct Bernie. I was looking at the STR2INT instruction in D0-More and thinking it was what I need. The info comes into the P2000 CPU via Ethernet/IP and is placed into an array. I was looking for a way to change from the ASCII format to integer. I have been investigating the suggested CPC instruction and how to use it.

  • adccommunitymod (AutomationDirect)

    Created Date: October 13,2015

    Created by: befraim

    Here is the solution I ended up with. ASCII data comes onto the CPU and is stored in an array. COPY ARRAY instruction moves data I need into a second array. COPY CHARACTER instruction converts and stores data as a string. UNPACK STRING instruction converts and stores data as an integer. Let me know if there is a simpler or more elegant method to do this. Thanks for your help!

  • adccommunitymod (AutomationDirect)

    Created Date: October 12,2015

    Created by: befraim

    A Keyence SR-750 barcode reader is sending ASCII numbers via Ethernet/IP to P2000 CPU. How do I convert the ASCII info to integer?

  • NNZ (Customer)

    Not really an answer, more of a bump and a question regarding the Ethernet/ip settings. We are tryiong to get the data from a Keyence SR-2000 reader and so far have been unable to get the string in anyway that we can use it/see it. Do you know what settings you used for the communications to the SR-730 reader?

    • z28z34man (Customer)

      This post was from back in 2015 and i don't any of these guys are still around.

       

      I know i tested a keyence barcode scanner with a productivity 1000 like 5 years ago and was able to get it to work but i do not know if i still have the program. That project ended up going with a IFM barcode scanner because it was significantly cheaper for similar performance.

      Expand Post
      • NNZ (Customer)

        Thanks for the response. I kind of figure it was a long shot, but thought someone else might have figured something out.

         

        we did actually manage to get the results from the reader, with a lot of trial and error. Once I get a cleaner version of the program I will try to post some screen shots of the settings that worked.

         

        Thanks again, much appreciated.

        Expand Post