![]() |
![]() ![]()
Experimental Physics and
| ||||||||||||||
|
Hi, I am encountering an issue while developing a modbus communication-based motor controller program, similar to the module motorAMCI. I am attempting to read the values in registers with function code 3 by relative address. For instance, if I want to read the value located in 0x602C, which represents the current position of the motor. I set the starting address to 0x6000 by the command in st.cmd drvModbusAsynConfigure("DM2C_1_1_In_Word", "L0", 1, 3, 24576, 2, 0, 0, "DM2C_stepper") Then to read the motor position, I called the function in driver.cpp with sentence status = pC_->readReg16(44, &read_val, DEFAULT_CONTROLLER_TIMEOUT); 24657 is 0x6000 and 44 is 0x2C, then I believe that the value at 0x602c could be accessed. The definition of the readReg16 is the same with the method ANG1Controller::readReg16() Consequently, I am unable to retrieve the correct register value, and an error is showed: 2024/11/22 17:57:00.751 DM2C_1_1_In_Word 2 autoConnect could not connect: Could someone please help me figure out what might be causing this issue? Thank you! Best regards, Shen Zhibang
| ||||||||||||||
ANJ, 28 Nov 2024 |
![]() · Download · Search · IRMIS · Talk · Documents · Links · Licensing · |