SBAppakaya (Customer) asked a question.

I am trying to use python to access XEL-BSSRT with XBE-DC08A to read a sensor output. What is the best place to start?

I started off with the library pyModbusTCP and the eeip. Nothing seems to work and it looks like there is not a lot of applications that use this. Any help is much appreciated.


  • ADC_LSElectricPLC_PE (AutomationDirect)

    The hex address in Modbus poll should be 202 with a quantity of 2. The data is only 2 bytes as shown in the addressing tool. Trying to read too much data will give an error.

     

    in python code, the 5 should be a 2. Trying to read too much data will cause it to fail.

    Selected as Best
  • Adisharr (Customer)

    You may want to start with a Modbus TCP interface application like ModbusPoll from the link below to establish communications and verify you can read when you need from the coupler.

     

    https://modbustools.com/modbus_poll.html

     

    If that works then you know exactly what addresses you need to read/write to/from.

    Expand Post
    • SBAppakaya (Customer)

      Thank you for a quick response.

       

      I think I started off in this path, but, I was getting the Write error for any configuration. Stopped there after that dead-end.

       

      They have a an addressing tool, which does not give many details. Attaching the screenshot, let me know if you have any suggestions.

       

      image

      Expand Post
      • ADC_LSElectricPLC_PE (AutomationDirect)

        You will use modbus function code 4 to read from hex address 0x30202. Here is a table to modify the addresses for the different function codes. From the user manual.

        image

      • SBAppakaya (Customer)

        Thank you. I think I was there as well. Here is the screenshot of Modbus poll configs I have used. Hope you had a chance to look at my response to your comment in the other thread.

         

        image

        Expand Post
      • ADC_LSElectricPLC_PE (AutomationDirect)

        Choose addressing mode of hex. Check address in cell also to see which address is for the data.

         

         

        With the pyModbusTCP library, write the code 'read_input_registers(514, 1)'

      • SBAppakaya (Customer)

        Still same error with Modbus Poll, But here are some variations of the configs:

         

        To match the PLC Address to '30202':

        image 

        With Hex selected and 514 as the input:

        image 

        Python code also didn't work. But here is the code and its output:

        image

        Expand Post
      • ADC_LSElectricPLC_PE (AutomationDirect)

        The hex address in Modbus poll should be 202 with a quantity of 2. The data is only 2 bytes as shown in the addressing tool. Trying to read too much data will give an error.

         

        in python code, the 5 should be a 2. Trying to read too much data will cause it to fail.

        Selected as Best
    • SBAppakaya (Customer)

      Thank you for the response. Here is the screenshot of the addressing tool. I had for some time now and I am not sure if I understand how to use the information in it with the ModbusPoll.

      image.png 

      I also have the XG5000 software and using the monitoring tool, I can see the inputs going on and off.

      imageimage 

      Expand Post