Hi everyone, This is my first post on this mailing list! I have a DDE problem that I hope someone could help me out with.
We have been using Facon Server software to control and monitor a PLC for a robot at my workplace. The software is freely available here: http://www.fatek.com/en/download.php?f=data/ftp//PLC/Fatek_Server/FaSvr116-16523_en.zip In the past, we used pywin32 v214 under Python 2.7, to communicate with Facon Server via the DDE interface, without any issues. We recently updated all our scripts to use Python 3.6.2, with pywin32 v220. Since then, we get a mysterious DDE error appear in response to Request operations. Everything worked previously under Python 2.7 and pywin32 214. If I write a very simple Python 3.6.2 DDE server with a Poke and Request operation, and invoke it by writing a simple Python 3.6.2 DDE client, then the operations seem to work fine too. So it seems like an interoperability issue between Python 3.6.2/pywin32 220, and the Facon Server software. But we are not sure where the problem is, or what the next step should be to try and solve this. Can anyone help? Here is a very simple code snippet: import win32ui import dde import time MAR_COMM_WRITE_DELAY = 0.300 MAR_COMM_READ_DELAY = 0.300 server = "FaconSvr" topic = 'Channel0.Station0.Group0' # Connect to Facom server dde_server = dde.CreateServer() dde_server.Create(server) conversation = dde.CreateConversation(dde_server) station = conversation.ConnectTo(server, topic) # DDE read of the robot angle time.sleep(MAR_COMM_READ_DELAY) angle = conversation.Request('R57') # RESULTS IN "DDE Error" print('Angle: {}\n'.format(int(angle))) # DDE write of the robot angle new_angle = angle + 10 time.sleep(MAR_COMM_WRITE_DELAY) conversation.Poke('R330', str(int(new_angle))) print('New Angle: {}\n'.format(int(new_angle)))
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32