shrirampendse
Member
Hello,
Something wrong with BCD and integer conversion it seems. I want to subtract 1 every second from a register, but something strange is happening , starting value in register is 1300 , now on every rising edge of 1 sec pulse i am subtracting 1 from it, result is ok till it reaches 1280 and then results are abrupt, it jumps to 1270, 1255, 1201 etc. Same thing happens for other register values. Instead of subtract instruction i used decrement still problem is same. I converted integer value coming into this register from hmi into BCD and back but problem remains.
Pls help , thanks
Something wrong with BCD and integer conversion it seems. I want to subtract 1 every second from a register, but something strange is happening , starting value in register is 1300 , now on every rising edge of 1 sec pulse i am subtracting 1 from it, result is ok till it reaches 1280 and then results are abrupt, it jumps to 1270, 1255, 1201 etc. Same thing happens for other register values. Instead of subtract instruction i used decrement still problem is same. I converted integer value coming into this register from hmi into BCD and back but problem remains.
Pls help , thanks
Last edited: