how come BCD Decrement for #20hex become &25 in decimal?

kartika

Member
Join Date
Jul 2011
Location
Lampung
Posts
31
i'm newbie in PLC, would u like to help me, plese..
i'm using an instruction MOV, for moving Hexadecimal data #0020 which is &32 in decimal,to memory D100, after that i'm decrementing(BCD decrement) the value of the memory D100,i'm confuse how come the result is &25(decimal)?
thank you for the attention :)

1.JPG
 
Decrementing BCD 20 results in BCD 19. If you convert from HEX 19 to decimal it becomes 25. Lesson: never mix your formatting unless you're absolutely certain what will be the outcome.

Kind regards,
 
thanks jean, its so help full
i understand, so if i got #30(hexadecimal) the result is #29 hex which is same with 41 in decimal, is it right?
#29 = 0010 1001
thank you very much
 

Similar Topics

hi... i have an issue in s7 300 plc, while we run the machine(in idle there is no fault) , plc cpu goes in SF mode, after restart the power cycle...
Replies
2
Views
117
Hi. I’m doing a PV 1400e to PVP 7 migration and I don’t know how to convert the old 8digit BCD type from PB1400e into something that will work on...
Replies
2
Views
591
I'm working on converting an old PanelBuilder 1200 HMI application into FactoryTalk View ME. The PLC was an old SLC 5/02 with a scanner card for...
Replies
2
Views
1,105
I have a Cmore screen which is communicating to the DL06 in BCD and need to create a timer that works in real numbers for a test, I simply need to...
Replies
3
Views
2,147
Hello, I am stumped on how to tackle this issue. I am working on an Energy project on a solar / wind farm and I am trying to read in some data...
Replies
7
Views
2,479
Back
Top Bottom