You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old July 24th, 2019, 07:03 AM   #1
TWControls
Lifetime Supporting Member
United States

TWControls is offline
 
TWControls's Avatar
 
Join Date: Oct 2005
Location: Roanoke, VA
Posts: 2,142
Allen Bradley 1762-IF2OF2 12 bit resolution, but 0-32760? Does anyone know why?

Hi guys, I'm working on an article about the bit resolution and precision of a 1762-IF2OF2. I know it is 12 bit which is 0-4096 and that the data is shifted by 3 bits to take up bits 3-14, making the range 0-32,760 instead. But I'm not sure I fully understand why this was done.

Does anyone know why this was done? Here's the explanation of the shift, I just think it leaves a big question lingering as to why. Obviously it makes the value look more precise, but that just doesn't seem like the correct answer.
https://www.theautomationstore.com/r...and-precision/
  Reply With Quote
Old July 24th, 2019, 09:08 AM   #2
GaryS
Member
United States

GaryS is offline
 
GaryS's Avatar
 
Join Date: Aug 2003
Location: Lancaster Pa.
Posts: 956
I can' say for sure but I would think is the resolution of the chip they use in card
12bit analog to digital are more common and cheaper, while they do make higher resolution chips they start to get pricey
  Reply With Quote
Old July 24th, 2019, 09:10 AM   #3
TWControls
Lifetime Supporting Member
United States

TWControls is offline
 
TWControls's Avatar
 
Join Date: Oct 2005
Location: Roanoke, VA
Posts: 2,142
Yes, but 12 bit is 0-4096. There is a 3 bit offset making the 12 bits use bits 3-14, changing the range to 0-32760. Why?
  Reply With Quote
Old July 24th, 2019, 09:19 AM   #4
danw
Member
United States

danw is offline
 
danw's Avatar
 
Join Date: Oct 2004
Location: midwest, USA
Posts: 2,974
Probably ease of data transfer over the backplane bus and within the operating system, where data words are likely 2 byte/16 bit words. Sign bit uses the MSB.
  Reply With Quote
Old July 24th, 2019, 10:14 AM   #5
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 14,841
I don't think there's a low-level technical reason, but rather a collection of decisions for compatibility and history.

MicroLogix is based on the SLC-500 operating system, of course, and the old 4-channel analog modules for the SLC used 12-bit A/D converters and provided a value between 0 and 4095.

But the newer MicroLogix 4-channel analog modules (1762-IF4) had higher resolution; 15 bits plus sign.

So when they built a low-resolution combination module for the same platform, the question arose; do we make this compatible with old examples and legacy code from the SLC-500, or do we make it as close as possible to its 4-channel, 15-bit siblings ?

The evident decision was to just shift the data left, so that the full-scale value was similar despite the resolution being lower.
  Reply With Quote
Old July 24th, 2019, 10:21 AM   #6
TWControls
Lifetime Supporting Member
United States

TWControls is offline
 
TWControls's Avatar
 
Join Date: Oct 2005
Location: Roanoke, VA
Posts: 2,142
Quote:
Originally Posted by Ken Roach View Post
I don't think there's a low-level technical reason, but rather a collection of decisions for compatibility and history.

MicroLogix is based on the SLC-500 operating system, of course, and the old 4-channel analog modules for the SLC used 12-bit A/D converters and provided a value between 0 and 4095.

But the newer MicroLogix 4-channel analog modules (1762-IF4) had higher resolution; 15 bits plus sign.

So when they built a low-resolution combination module for the same platform, the question arose; do we make this compatible with old examples and legacy code from the SLC-500, or do we make it as close as possible to its 4-channel, 15-bit siblings ?

The evident decision was to just shift the data left, so that the full-scale value was similar despite the resolution being lower.
Thanks Ken. I figured I was missing the obvious. I didn't think about matching up to the 1762-IF4's units.

Now why didn't they continue that with built in analog?
  Reply With Quote
Old July 24th, 2019, 02:01 PM   #7
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,941
Quote:
Allen Bradley 1762-IF2OF2 12 bit resolution, but 0-32760? Does anyone know why?
Yes! We do this internally on our products. Analog inputs are 'normalized' by shifting them left to make signed or unsigned numbers. We shift unsigned inputs left 15-number of bits and signed inputs 16-number of bits. This way all our code is written for 0-32767 or -32768 to +32767. Sometimes we filter the inputs. The lower bits arer used then. When computing analog outputs for a servo valve or motor, the outputs are always normalized to be -32768 to 32767. If the output has only 12 bits then only the upper 12 bits are used. However, we keep track of the lower bits to provide a PWM effect on the lower bits.

Things have changed with the new 32 bit CPUs. We now have 18 bit analog inputs but the values are still shifted left

I think this is common in motion control. It doesn't surprise me at all that others would do the same. This way the main part of the code always treats the values the same regardless of the number of bits the inputs have.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 24th, 2019, 02:47 PM   #8
TWControls
Lifetime Supporting Member
United States

TWControls is offline
 
TWControls's Avatar
 
Join Date: Oct 2005
Location: Roanoke, VA
Posts: 2,142
Quote:
Originally Posted by Peter Nachtwey View Post
Yes! We do this internally on our products. Analog inputs are 'normalized' by shifting them left to make signed or unsigned numbers. We shift unsigned inputs left 15-number of bits and signed inputs 16-number of bits. This way all our code is written for 0-32767 or -32768 to +32767. Sometimes we filter the inputs. The lower bits arer used then. When computing analog outputs for a servo valve or motor, the outputs are always normalized to be -32768 to 32767. If the output has only 12 bits then only the upper 12 bits are used. However, we keep track of the lower bits to provide a PWM effect on the lower bits.

Things have changed with the new 32 bit CPUs. We now have 18 bit analog inputs but the values are still shifted left

I think this is common in motion control. It doesn't surprise me at all that others would do the same. This way the main part of the code always treats the values the same regardless of the number of bits the inputs have.
Thanks for the explanation Peter. It makes more sense to me now.
  Reply With Quote
Old July 25th, 2019, 03:37 AM   #9
parky
Member
United Kingdom

parky is offline
 
Join Date: Oct 2004
Location: Midlands
Posts: 1,232
Interesting.... Siemens use the lower 3 bits as diagnostic bits, years ago this foxed me a little (RTFM doh..) So in that case we used to move the lower 3 bits to flags for diagnostic purposes then shift the data to remove them giving the correct value.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Fanuc 90/30 HMI programming CalG LIVE PLC Questions And Answers 128 February 27th, 2013 12:11 AM
Allen Bradley HMI Chopperman LIVE PLC Questions And Answers 13 June 7th, 2012 07:35 AM
S7 Indirect bit addressing curlyandshemp LIVE PLC Questions And Answers 1 October 4th, 2006 01:40 AM
counters and Timers of Allen Bradley Program ronpittc LIVE PLC Questions And Answers 15 July 4th, 2003 02:12 AM
Allen Bradley Binary Bit (B3) PERSPOLIS LIVE PLC Questions And Answers 2 December 18th, 2002 02:06 PM


All times are GMT -5. The time now is 10:58 PM.


.