brooksg44 (Customer) asked a question.

Productivity 2000 as Ethernet/IP Adapter

The Click has an example of making the Click an adapter and connecting to AB CompactLogix. (Click Help topic CL235).

 

What would be the best way to make the P2-622 be an ethernet/ip adapter and mimic this example using just one data block?

image


  • ADC Community_03 (AutomationDirect)

    Unfortunately that is tricky because Float byte order is very dependent upon the device and its architecture. Attached is an example that can move bytes from an array to float array tags and in the opposite direction. It allows for easy re-arrangement of the bytes to accommodate the different float byte orders of devices in our industry. There may be more 'elegant' solutions but this is one put together pretty quickly.

    Selected as Best
  • ADC Community_03 (AutomationDirect)

    The setup for an Adapter in Productivity Series is similar to CLICK but only allows for 1 array in the Input data side (T>O) and 1 array on the Output side (O>T). This is explained in topic P257. To allow for mixed data types, you would need to copy the other data type arrays in and out of the arrays assigned to the EIP Adapter function. You can use the CPD (Copy Data) instruction to copy tag by tag OR (more efficiently) use a few CPA (Copy Array) instructions to move blocks at a time.

  • brooksg44 (Customer)

    Is there no way to write a Float to 4 bytes or read 4 bytes into a Float?

    • ADC Community_03 (AutomationDirect)

      Unfortunately that is tricky because Float byte order is very dependent upon the device and its architecture. Attached is an example that can move bytes from an array to float array tags and in the opposite direction. It allows for easy re-arrangement of the bytes to accommodate the different float byte orders of devices in our industry. There may be more 'elegant' solutions but this is one put together pretty quickly.

      Selected as Best
      • brooksg44 (Customer)

        That is a lot of code to accomplish this. But it works. Thanks for showing transfer both ways. Looks like I have a lot of work to do to convert my original mapping from above. Well I would say that your code is pretty elegant in itself. Thanks for taking the time to do such a detailed and commented example.

         

      • ADC Community_03 (AutomationDirect)

        Agreed. It ended up being more than I had originally thought. We are discussing with the product group how we might make this a little easier in the future.

  • brooksg44 (Customer)

    @ADC Community_03 (AutomationDirect)​ Here is my Final Solution for my original problem. Wasn't that familiar with ProductivitySuite Advanced programming and I couldn't have done it without your Bytes_to_Floats example. I haven't cleaned up all the comments. Just wanted to thank you again for your detailed example.

  • brooksg44 (Customer)

    @Durallymax I was trying to use UDS But couldn't seem to get Productivity to write the structure to my block of 120 bytes. Take a look at TS3b-Adapter and give hints how you would have done it with Unions.

    • Durallymax (Customer)

      When I try to open either example it gives me an error. Likely don't have a new enough version to open it.

       

      This is what it looks like with a Union though, just rearrange the byte order as needed. Psuite doesn't have support for these. CODESYS does. I believe Do-More may have a similar mechanism.Screenshot 2025-12-10 072555

      Expand Post