Trouble with OpenOPC execution

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trouble with OpenOPC execution

papakos
This post has NOT been accepted by the mailing list yet.
I have this script

import wx
import OpenOPC

class MyForm(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY, "OpenOPC",
                                   size=(500,500))
        panel = wx.Panel(self, wx.ID_ANY)
        self.toggleBtn = wx.Button(panel, wx.ID_ANY, "Connect")
        self.toggleBtn.Bind(wx.EVT_BUTTON, self.onToggle)

    def onToggle(self, event):
        btnLabel = self.toggleBtn.GetLabel()
        if btnLabel == "Connect":
            self.toggleBtn.SetLabel("Disconnect")
            print "starting connection..."
            PLC = OpenOPC.client()
            PLC.connect('CoDeSys.OPC.02')
        else:
            print "stop connection..."
            self.toggleBtn.SetLabel("Connect")

if __name__ == "__main__":
    app = wx.App()
    frame = MyForm().Show()
    app.MainLoop()

and when i am going to execute with pyinstaller 3.1 and run the exe file i have this result



what i'm missing?
thnks
Loading...