Hi everyone,
I'm currently working on integrating Modbus RTU into my milling machine setup, using Chinese AASD-Servos that support the protocol. So far, I've successfully read float values, such as spindle load, from the servos using mb2hal. However, I'm facing a challenge when it comes to reading the status of output pins on address 386 from the motor.
The motor provides the status of various output pins, which I currently read using MB2HAL with "MB_TX_CODE=fnct_03_read_holding_registers," returning a float value. However, I need this data in binary format to analyze each bit individually, as these bits indicate crucial information like motor readiness or alarms.
I refer to the servo manual, where, for instance, if the motor is online but not turning, I receive the float value 14900. I need to convert this to the binary value "11101001010100," where the first bit '1' indicates no alarm.
My question is whether there's a HAL component like CONV_S32_BIT that I can use for this purpose or if there's a simpler way to read bitwise information using MB2HAL.
Any help or guidance on this matter would be greatly appreciated. Thank you!