Python sample for communication with Mitsubishi Electric CNC M700 series using EZSocket.
It works by using COM object in Windows environment.
Please use as a hint when implementing in your own environment.
-Reading and writing values ββto D and M devices -Acquisition of information such as NC status, tool number and rotation speed -Directory search and file operations in NC (read / write / delete)
The following Mitsubishi CNC communication software development kit is required in a Windows environment.
http://www.mitsubishielectric.co.jp/fa/document/others/cnc/ib-1501208/IB-1501208.pdf
http://docs.activestate.com/activepython/3.4/pywin32/html/com/win32com/HTML/variant.html https://mail.python.org/pipermail/python-win32/2012-October/012575.html
http://nullege.com/codes/search/pythoncom.VT_VARIANT
from m700 import M700
# Open connection
m700 = M700.get_connection ('192.168.1.10:683') #683 is the default port for Mitsubishi M70 CNC controllers
# Get information in NC
m700.get_drive_infomation ()
m700.get_run_status ()
m700.get_alarm ()
# Operation on D device
m700.write_dev ('M900', 1)
m700.read_dev ('M900') #-> 1
# Operations on M device
m700.write_dev ('D200', 10)
m700.read_dev ('D200') #-> 10
# Manipulate machining program files (read / write / delete)
drivenm = m700.get_drive_infomation ()
m700.write_file (drivenm + '\ PRG \ USER \ __ TEST __. txt', b'TEST_WRITE ')
m700.read_file (drivenm + '\ PRG \ USER \ __ TEST __. txt')
m700.delete_file (drivenm + '\ PRG \ USER \ __ TEST __. txt')
# Close connection
m700.close ()
[TODO]
- Update tests to include changes made
- Complete translations