Announcement

Collapse
No announcement yet.

Custom Protocol Ethernet on Productivity2000 Help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • Custom Protocol Ethernet on Productivity2000 Help!

    I am currently trying to weight a part on a scale with a P2-550 CPU as my interface. I will be placing a part on the scale and sending a trigger/capture command (PRT=print + Carriage Return) to it via Ethernet. I will then receive back the value as a string. Use the compare instruction to make an OK or NG judgement and move that part along in my process or scrap it due to under weight. I'm trying to use the Custom Protocol Ethernet instruction to accomplish this. It is not consistent, if I look in my Data View; I have say 3 sent and 2 received with 1 packet pending. It will not update properly. How would I go about clearing my data at every trigger/capture? Any help with this would be great!


  • #2
    That means you have sent three request, received 2 responses and have 1 waiting in the queue. So if you enable the CPE receive again the sent and received should be equal. The sent and received are accumulated values for the device so it is possible they could get off. The pending is telling you how many messages there are in the queue waiting to be received. ( Max of 10 I believe.)

    Comment



    • #3
      Thanks techme! I'm working on this issue with my coworker Integrator123. We are trying to tag team this debugging for the project and can't seem to make any headway. Just frustrating, as it's the first time we have used any of this hardware. I still can't figure out where I'm sending 3 requests, but I put a simple timer in and enabled the CPE receive again and again, wil no luck. Back to the drawing board. Thanks again for the quick reply!

      Comment



      • #4
        Sounds like integrator123 was close to having it working. The unanswered question was how many responses are you receiving per request from to the slave device?

        If you just do one Send CPE and then look at your messages pending tag for that device you should see how many responses are getting stored in the queue. Once you know this you can decide if you will need to have logic to read more than one response or if the device is sending everything in one response packet. You can clear the information and repeat multiple times to make sure it is consistent.
        Once you know how this is acting you can add a Receive CPE and just use an internal bit to receive the string. If it is one message you should get the string. If it is more than one then to see what is happening you may have to use a one shot to trigger the receive more than once to see the queue being read in.
        When you see and understand what is happening you can just use the Messagespending tag in a compare as shown below and the logic below it to append the string into a final string.

        Click image for larger version

Name:	ASCII_ENET.PNG
Views:	193
Size:	12.6 KB
ID:	123192

        Comment



        • #5
          Thank you for the reply and example. I sent 3, received 3, but have 4 pending. I'm sending this trigger to the scale to start the program with a fiber sensor in this testing stage as I'm just sticking my hand through it to trigger. Could it be the inconsistencies of my hand breaking the light beam and 'sending 2 triggers' at once?

          Click image for larger version

Name:	Capture.PNG
Views:	92
Size:	46.4 KB
ID:	123226

          Comment



          • #6
            This screenshot does not show the CPE send instruction. If you make the CPE send once it should only send once. Use an internal bit in your logic and turn it on in dataview. It should send one message.

            Also where is your logic located? "Run every scan" "Run When Called"?

            Can you attach your project?

            Comment



            • #7
              techme, my 2 input sensors are just used for triggers in the debug process. Disregard the tag names. Here is my project 190607.zip

              Comment

              Working...
              X