Mark_Gollinger

CLX Tag Structure

3 posts in this topic

This tag is a bool.  

ZONE1_BSL_ARRAY[(PNT_STA1 AND(NOT 31))/32].[PNT_STA1 AND 31]

Has anyone seen this structure before?

Zone1_BSL Array is 63 dints and Pnt_STA1 is a dint

I get that it is an indirect tag, but how does the math work?(NOT 31)/32

 

 

Share this post


Link to post
Share on other sites

The word selection is zeroing the lowest five bits of the overall desired bit, then dividing by 32 to shift over by five bits.  The bit selection simply zeros all but the lowest five bits.

Whoever did this is simply re-inventing the wheel.  Arrays of booleans in Logix occupy an array of 32-bit words under the hood (and when viewed externally).  A single subscript into the boolean array does all of this math for the user.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks for the explanation. This logic probably came from an older conversion.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now