Archie
Member
I was working on a project and ran into a problem that seemed very simple at first, but became quite a challenge to implement in RSLogix 500. Although I did come up with solution, it seemed like a lot of ladder code, so I wanted to see how others would do this.
I have a long integer (L9:0) that needs to be broken into 2 integers (N7:0, N7:1). The divisor is 10,000. Some examples:
L9:0= 78200
result:
N7:0= 7
N7:1= 8200
L9:0= -553333
result:
N7:0= -55
N7:1= -3333
L9:0= 649999
result:
N7:0= 64
N7:1= 9999
I have a long integer (L9:0) that needs to be broken into 2 integers (N7:0, N7:1). The divisor is 10,000. Some examples:
L9:0= 78200
result:
N7:0= 7
N7:1= 8200
L9:0= -553333
result:
N7:0= -55
N7:1= -3333
L9:0= 649999
result:
N7:0= 64
N7:1= 9999