I am trying to extract data from programmable logic controller's registers using Raspberry PI module and then display it on screen. I have installed pymodbus package on my Rpi. I am quite unsure how to proceed further.
1 Answer
You need to read the documenation for the package. Unlike some packages you'll encounter, http://pymodbus.readthedocs.io/en/latest/ is REALLY well documented. You'll need to ascertain the location and types of your registers. Did you code the PLC, or do you have the documentation for the logic which is contained? Armed with this information, look at one of the creators four frontend examples. If that's not enough, look at one of the twelve user-supplied examples. I'd recommend "modbus scraper", but it;s a serial port example. It does give examples of all the calls you'll need. The single server example should show you how to make the TCP/IP connection.
-
Thanks a lot KDM. I really new into this, can you suggest me some websitre where I can look into the basics Modbus protocol terminologies, because I am not understanding those examples clearly.– SahanMay 18, 2016 at 8:13
-
The modbus spec is long. If you dropped it on your foot, you'd break your toe. First, you need a sort of "taster". Google it. I would go to simplymodbus.ca/FAQ.htm. Don't be intimidated by the large index: everything you need is right there on the one page. If you know the basics about computing, micros, hexadecimal, etc. then you can discard half of it.– KDMMay 18, 2016 at 20:39