bit array for more then 32 devices

Hi,

I have this array that count up to 32 devices:

if bit.band(devstatus[3],2^(i-1)) > 0 then state = “1” end

I would like to get 128 devices in the array. Anybody knows how to do that?

Thanks

Regards

Claus

[quote=“Blaabjerg, post:1, topic:193493”]I have this array that count up to 32 devices:

if bit.band(devstatus[3],2^(i-1)) > 0 then state = “1” end

I would like to get 128 devices in the array. Anybody knows how to do that?[/quote]

Not with Lua integers. They are 32 bits long so you can’t stuff 128 bits into one under any circumstances. You’ll have to modify other bits of the code to compensate.