Classicladder, Modbus and read values of a servo motor

08 Feb 2019 20:11 - 08 Feb 2019 20:22 #126017 by rodw
I have never used Classic Ladder but I think the problem might be that the servo is sending a 16 bit signed value and it is being received into a S32 which is a 32 bit signed number.

So the 16 bit number is reserving the 8th bit to be the sign (eg Hex 1000-0000)
and the 32 bit number is reserving the 16th bit as the sign (10000-0000-0000-0000)
So for -1, the servo sends 1000-0001 but you are seeing 0000-0000-1000-0001 so the signed bit is not set

From a quick look at the CL docs there are functions MINI and MAXI which I think are to deal with this situation and limit the allowable values but I can't help further.
Last edit: 08 Feb 2019 20:22 by rodw.
10 Feb 2019 13:25 #126145 by MATZE-ATZE-SCH
now I have understand...
I will look at the MINI and MAXI funktions,
maybe this is a better solution than my things in CL.
Time to create page: 0.072 seconds
Powered by Kunena Forum