If you set toggle mode it's necessary to read value before to change it because if current value is 0 toggling mean that you want write 1 and viceversa. So, the reading function doesn't work returning always true so the toggling always write 0. Instead of using reading function (for reading directly from PLC) you can use the value in VALUE property of the object (you must modify the code of the object you are using, i.e. a pilot light)