28.04.2021, 09:25
(28.04.2021, 07:51)Daniel. Wrote: write_bitmask Boolean FW 2020.10 and newer
Set to true to enable writing shifted value to the register using value_bitmask. Only uint16 datatype is supported
Hello
the json file below makes me a strange thing, any bit I write in the LM always writes me only the first bit in the PLC.
the strange thing is that as far as the analog values are concerned, everything works perfectly.
Where am I wrong?
Code:
{
"manufacturer": "SIEMENS",
"description": "S7 1200",
"mapping": [
{"name": "SERRA 7 SP TEMP","address": 0,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 7 TEMP","address": 2,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 7 V_MAN_REG","address": 4,"bus_datatype": "float32","datatype": "float32","type": "register","units": " Hz","writable": "true"},
{"name": "SERRA 7 ISTERESI","address": 6,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 7 ASS 1","address": 8,"bus_datatype": "float32","datatype": "float32","type": "register","units": " A","writable": "false"},
{"name": "SERRA 7 ASS 2","address": 10,"bus_datatype": "float32","datatype": "float32","type": "register","units": " A","writable": "false"},
{"name": "SERRA 7 A/M REG","address": 12,"read_swap":"bw","value_bitmask":"0x1","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 CMD INV 1","address": 12,"read_swap":"bw","value_bitmask":"0x2","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 RUN INV 1","address": 12,"read_swap":"bw","value_bitmask":"0x4","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 ALM INV 1","address": 12,"read_swap":"bw","value_bitmask":"0x8","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 ACK INV 1","address": 12,"read_swap":"bw","value_bitmask":"0x10","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 CMD INV 2","address": 12,"read_swap":"bw","value_bitmask":"0x20","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 RUN INV 2","address": 12,"read_swap":"bw","value_bitmask":"0x40","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 ALM INV 2","address": 12,"read_swap":"bw","value_bitmask":"0x80","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 7 ACK INV 2","address": 12,"read_swap":"bw","value_bitmask":"0x100","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 SP TEMP","address": 14,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 8 TEMP","address": 16,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 8 V_MAN_REG","address": 18,"bus_datatype": "float32","datatype": "float32","type": "register","units": " Hz","writable": "true"},
{"name": "SERRA 8 ISTERESI","address": 20,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 8 ASS 1","address": 22,"bus_datatype": "float32","datatype": "float32","type": "register","units": " A","writable": "false"},
{"name": "SERRA 8 ASS 2","address": 24,"bus_datatype": "float32","datatype": "float32","type": "register","units": " A","writable": "false"},
{"name": "SERRA 8 A/M REG","address": 26,"read_swap":"bw","value_bitmask":"0x1","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 CMD INV 1","address": 26,"read_swap":"bw","value_bitmask":"0x2","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 RUN INV 1","address": 26,"read_swap":"bw","value_bitmask":"0x4","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 ALM INV 1","address": 26,"read_swap":"bw","value_bitmask":"0x8","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 ACK INV 1","address": 26,"read_swap":"bw","value_bitmask":"0x10","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 CMD INV 2","address": 26,"read_swap":"bw","value_bitmask":"0x20","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 RUN INV 2","address": 26,"read_swap":"bw","value_bitmask":"0x40","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 ALM INV 2","address": 26,"read_swap":"bw","value_bitmask":"0x80","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 8 ACK INV 2","address": 26,"read_swap":"bw","value_bitmask":"0x100","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 SP TEMP","address": 28,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 9 TEMP","address": 30,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 9 V_MAN_REG","address": 32,"bus_datatype": "float32","datatype": "float32","type": "register","units": " Hz","writable": "true"},
{"name": "SERRA 9 ISTERESI","address": 34,"bus_datatype": "float32","datatype": "float32","type": "register","units": " C°","writable": "true"},
{"name": "SERRA 9 ASS 1","address": 36,"bus_datatype": "float32","datatype": "float32","type": "register","units": " A","writable": "false"},
{"name": "SERRA 9 ASS 2","address": 38,"bus_datatype": "float32","datatype": "float32","type": "register","units": " A","writable": "false"},
{"name": "SERRA 9 A/M REG","address": 40,"read_swap":"bw","value_bitmask":"0x1","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 CMD INV 1","address": 40,"read_swap":"bw","value_bitmask":"0x2","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 RUN INV 1","address": 40,"read_swap":"bw","value_bitmask":"0x4","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 ALM INV 1","address": 40,"read_swap":"bw","value_bitmask":"0x8","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 ACK INV 1","address": 40,"read_swap":"bw","value_bitmask":"0x10","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 CMD INV 2","address": 40,"read_swap":"bw","value_bitmask":"0x20","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 RUN INV 2","address": 40,"read_swap":"bw","value_bitmask":"0x40","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 ALM INV 2","address": 40,"read_swap":"bw","value_bitmask":"0x80","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"},
{"name": "SERRA 9 ACK INV 2","address": 40,"read_swap":"bw","value_bitmask":"0x100","bus_datatype": "bool","datatype": "uint16","type": "register","writable": "true"}
]
}
Thanks so much
Code:
Thanks so much