Closed johanfforsberg closed 8 years ago
Thanks! Fixed; rolled version 3.9.2
I am trying to write a BOOL tag on Omron NX1P2 PLC.
When I read the tag declared as BOOL on the PLC I get an INT list of 2 elements with the first element representing the corresponding BOOL value.
I cannot write the tag instead and this is my trial:
via = proxy( shelf[identifier].ip_address )
with via:
value = True
params = via.parameter_substitution('mytag = (BOOL)' + str(value))
tag_value, = via.write(params, checking=True)
any suggestion? Thanks a lot
Hello! try to replace
class BOOL( TYPE ):
tag_type = 0x00c1
struct_format = 'B'
with
class BOOL( TYPE ):
tag_type = 0x00c1
struct_format = '<H'
in parser.py i was able to write BOOL from ONRON NJ series
Writing boolean tags is broken so that whatever value specified, it will always be interpreted as True. This fix allows "0" or "false" to write false, and any other number or "true" to write true. Not sure what should be allowed exactly.