Ron Beaufort
Lifetime Supporting Member
see if this works ...
Mikey,
based on what you’ve posted ... and on quite a few assumptions (gosh I hate that word) here are the specifications that I !-THINK-! you were interested in ...
if for some reason, I’ve got this wrong, then please use this same format and nail down EXACTLY what you !-DO-! want ... I’ll be glad to try again ...
good luck with your project ...
and incidentally ... the XPY instruction might “look” more glamorous and a lot of programmers would be tempted to use it for this application ... but ... XPY is a scan-time HOG! ... the approach that I used is based on a “brute force” longhand conversion - but the processor will be able to execute it a lot faster this way ... and ... it will also be a lot easier for someone else to understand further down the road ...
note: I've included both the .RSS format and the .PDF format in the zip file - just in case someone without RSLogix500 is interested ...
Mikey,
based on what you’ve posted ... and on quite a few assumptions (gosh I hate that word) here are the specifications that I !-THINK-! you were interested in ...
when +9,999,999 is input at F8:0
N7:1 will contain 0000 0000 1001 1000
N7:0 will contain 1001 0110 0111 1111
when -9,999,999 is input at F8:0
N7:1 will contain 1111 1111 0110 0111
N7:0 will contain 0110 1001 1000 0001
when 0 is input at F8:0
N7:1 will contain 0000 0000 0000 0000
N7:0 will contain 0000 0000 0000 0000
when 32,767 is input at F8:0
N7:1 will contain 0000 0000 0000 0000
N7:0 will contain 0111 1111 1111 1111
when 65,535 is input at F8:0
N7:1 will contain 0000 0000 0000 0000
N7:0 will contain 1111 1111 1111 1111
when 65,536 is input at F8:0
N7:1 will contain 0000 0000 0000 0001
N7:0 will contain 0000 0000 0000 0000
when 7 is input at F8:0
N7:1 will contain 0000 0000 0000 0000
N7:0 will contain 0000 0000 0000 0111
when -7 is input at F8:0
N7:1 will contain 1111 1111 1111 1111
N7:0 will contain 1111 1111 1111 1001
if for some reason, I’ve got this wrong, then please use this same format and nail down EXACTLY what you !-DO-! want ... I’ll be glad to try again ...
good luck with your project ...
and incidentally ... the XPY instruction might “look” more glamorous and a lot of programmers would be tempted to use it for this application ... but ... XPY is a scan-time HOG! ... the approach that I used is based on a “brute force” longhand conversion - but the processor will be able to execute it a lot faster this way ... and ... it will also be a lot easier for someone else to understand further down the road ...
note: I've included both the .RSS format and the .PDF format in the zip file - just in case someone without RSLogix500 is interested ...
Last edited: