Function
Retrieves bit information from byte information.
Format
modbus_set_bits_from_byte( dest , index , value )
Parameters
dest [ C : uint8_t * ] [ Python : ctypes.POINTER(ctypes.c_int) ]
Specify the start address of the array that stores the converted bit information.
index [ C : int ] [ Python : ctypes.c_int ]
Specify the start position to set the converted bit information in the dest array.
value [ C : uint8_t ] [ Python : ctypes.c_uint8 ]
Specify the data to be converted to bit information.
Return values
None
Remarks
Converts from byte information to bit information.
Gets byte information and converts it to bit information. The converted bit information is stored in the array dest.
Example
Retrieves the bit array [0, 1, 0, 1] from byte information 10.
C |
uint8_t dest[4]; uint8_t value = 10; modbus_set_bits_from_byte( dest, 0, value );
|
Python |
uint8_buff_type = ctypes.c_uint8 * 4 dest = uint8_buff_type() value = ctypes.c_uint8 value = 10 modbus.modbus_set_bits_from_byte(dest, 0, value)
|