[python-win32] DDE error with Facon Server software when using v220 under Python 3.6.2

Quang Thai qlthai at gmail.com
Tue Sep 4 04:53:35 EDT 2018


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)))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20180904/8f7ca7fb/attachment.html>


More information about the python-win32 mailing list