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 :)