multi dimension array

Hi everyone,

I was working with modbus and i just need a little help with this,

i have a MbData array of type word and size 30. (Mbdata[30]:wink:

now if i want to access the 3 bit of second word how do i do that ?

That is not a multi dimensional array.
You can only access one word at a time, if you want bits you have to extract them from the recovered value.

As Grumpy_Mike has said, your Mbdata[30] array is single dimensional. (P.S. watch capitalization. You have both "MbData" and "Mbdata". gcc will take those two names as completely different variables.)

Now...

now if i want to access the 3 bit of second word how do i do that ?

try something like this: boolean returnVaule = bitRead(Mbbata[1], 2); Remember both arrays and bit locations start counting with zero.