PLCS.net - Interactive Q & A

PLCS.net - Interactive Q & A (http://www.plctalk.net/qanda/index.php)
-   LIVE PLC Questions And Answers (http://www.plctalk.net/qanda/forumdisplay.php?f=2)
-   -   plc-python (http://www.plctalk.net/qanda/showthread.php?t=120893)

kkhabeeb June 10th, 2019 06:53 AM

plc-python
 
hello friends,am new to this group, currently am working in automation company,so i have to communicate my python with my unitronics PLC v350 to fetch and write process variable, any one can give me a simple program or introduction

kallileo June 10th, 2019 01:15 PM

Does it have RS485 or Ethernet ports?
You could AdvancedHMI (google it) and use it to communicate with your PLC.
It supports VB.Net and C#.
For Python you need a Modbus library and I believe you can easily find one if look it up.

For example:

https://sourceforge.net/projects/eas...dp-rtu-python/

kkhabeeb June 10th, 2019 11:20 PM

yes, friend, ihave a rs485 port

kallileo June 11th, 2019 10:03 AM

Connect the PC to plc using a USB to rs485 converter. Then setup modbus rtu slave on your plc and use your Python code to read and write data.

kkhabeeb June 11th, 2019 10:46 PM

yes , i have done the communication with moxa (usb-rs485) ,can you get me a basic python script to communicate with the plc

kwade June 12th, 2019 06:53 AM

It seems like a lot of good example code already exists. It is generic, but maybe you can mod it to suit your needs.

Look here
https://pymodbus.readthedocs.io/en/v...us-client.html

I don't know python, but from a quick read, it seems to support reading/writing coils/registers using pymodbus TCP, UDP, ASCII and RTU,


All times are GMT -5. The time now is 03:48 AM.

.