View Single Post
Old October 12th, 2017, 12:02 PM   #8
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,001
Quote:
Originally Posted by cefisher15 View Post
Daba,

Thank you for your help! Looking at the other rungs of code, I agree that the"/" is a bit address. Taking into consideration your remarks, and what I know about the expected values of NUMST, I think the expression is basically concatenating bit 16 with bits 0-7 to make a 9-bit binary representation of a number, then storing the decimal equivalent in NUMST (see attached).
Your attached image is what I was working towards with bit 16 being "rotated" left by 8 bits, but I think that it would end up in bit 6, not bit 10. In a 16-bit integer, with the bits octally addressed, bit 6 and 16 are 8 bits apart, whichever way you shift.

Perhaps the number constraints mean that it is creating a 7-bit number, with bit 6 being the sign bit ??? EDIT : I meant 7, not 9

Whatever way you look at it, it's a rare piece of programming, I'm sure there would be a better way to do, IF we could understand what it is trying to achieve !!
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; October 12th, 2017 at 12:39 PM.
  Reply With Quote