Jump to content

Recommended Posts

Posted

Hello guys,

I´m unable to find instruction which would return how many bits are ON in word (like 1 for 2, 4, 8... 2 for 3, 5, 9 etc..)

I was searching through manuals, but without any result... Maybe wrong keywords, maybe to many hours today..

 

Thanks in advance


Posted

If it is for FX PLCs, the instruction SUM should do it (FNC 43 – SUM / Sum of Active Bits - this instruction counts the number of "1" (ON) bits in the data of a specified device). Or DSUM for 32 bits.

  • Like 2

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
×
×
  • Create New...