stlehmann / pyads

Python wrapper for TwinCAT ADS
MIT License
252 stars 93 forks source link

How can I write values into enumeration in twincat3 via. pyads #311

Closed Schwarz-XU closed 2 years ago

Schwarz-XU commented 2 years ago

I'm recently using the package pyads to connect to Beckhoff TwinCAT3. The reading and writing methods work smoothly. (BTW: TwinCAT3 works fine)

But some error occurs when I try to write a value into an enumeration in TwinCAT3.

I'm using the easiest code to test: eCtrlMode = plc.write_by_name("GVL_Tset.stTest.eCtrlMode", 1) eCtrlMode is the instance of an enumeration "E_CtrlMode". The enumeration "E_CtrlMode in" TwinCAT3 as following: TYPE E_CtrlMode: ( Off := 0, Auto := 1, Reset := 10, Manual := 20 ); END_TYPE

Error returns: TypeError: 'NoneType' object is not callable Any help, direct or recommended reading would be appreciated :)

Schwarz-XU commented 2 years ago

It's been solved :)