Runtime: STRING type for Python PLC Globals was making problem with strings, since generated code wasn't doing comparison properly.
--- a/py_ext/PythonFileCTNMixin.py Tue Jun 16 15:53:52 2020 +0200
+++ b/py_ext/PythonFileCTNMixin.py Wed Jun 17 14:30:55 2020 +0200
@@ -242,8 +242,8 @@
varpubonchangefmt = """\
if(!AtomicCompareExchange(&__%(name)s_rlock, 0, 1)){
IEC_%(IECtype)s tmp = __GET_VAR(%(configname)s__%(uppername)s);
- if(__%(name)s_rbuffer != tmp){
- __%(name)s_rbuffer = %(configname)s__%(uppername)s.value;
+ if(NE_%(IECtype)s(1, NULL, __%(name)s_rbuffer, tmp)){
+ __%(name)s_rbuffer = tmp;
PYTHON_POLL_body__(__%(name)s_notifier);
}
AtomicCompareExchange((long*)&__%(name)s_rlock, 1, 0);