bachmann-m200 / baem200

Other
4 stars 6 forks source link

Exception getListofSviVariables() #40

Open Schueder opened 1 year ago

Schueder commented 1 year ago

An exeption occures, by call swModule.getListofSviVariables() if single variables are not allowed to read.

Sample Code: from baem200.m1com import M1Controller, _M1SwModule usr = "username" pwd = "password" m1 = M1Controller(ip=ip,username=usr,password=pwd); m1.connect() swModule = _M1SwModule('RES', m1) swModule.getModHandle() print(swModule.getNumberofSviVariables()) print(swModule.getListofSviVariables()) m1.disconnect()

Error-msg: Traceback (most recent call last): File "C:\Users\nesc\Documents\fraunhofer\python_m1com_demo\get_sviList.py", line 24, in print(swModule.getListofSviVariables()) File "C:\python\python39\lib\site-packages\baem200\m1com.py", line 3033, in getListofSviVariables py_svivarlist[myVarEntrys.ARRAY[num].name.decode('utf-8')] = _SVIVariable(myVarEntrys.ARRAY[num].name.decode('utf-8'), self) File "C:\python\python39\lib\site-packages\baem200\m1com.py", line 3075, in init self.attach() File "C:\python\python39\lib\site-packages\baem200\m1com.py", line 3116, in attach raise PyComException(("pyCom Error: Can't attach SviVariable["+self.name+"] from Module["+self._module.name+"] on Controller["+self._m1ctrl._ip+"]")) baem200.m1com.PyComException: "pyCom Error: Can't attach SviVariable[] from Module[RES] on Controller[10.11.31.28]"