- Configuring LinuxCNC
- Advanced Configuration
- ClassicLadder
- Classicladder, Modbus and read values of a servo motor
Classicladder, Modbus and read values of a servo motor
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10795
- Thank you received: 3556
08 Feb 2019 20:11 - 08 Feb 2019 20:22 #126017
by rodw
Replied by rodw on topic Classicladder, Modbus and read values of a servo motor
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.
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.
Please Log in or Create an account to join the conversation.
- MATZE-ATZE-SCH
- Offline
- Senior Member
Less
More
- Posts: 51
- Thank you received: 6
10 Feb 2019 13:25 #126145
by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Classicladder, Modbus and read values of a servo motor
OK,
now I have understand...
I will look at the MINI and MAXI funktions,
maybe this is a better solution than my things in CL.
now I have understand...
I will look at the MINI and MAXI funktions,
maybe this is a better solution than my things in CL.
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- ClassicLadder
- Classicladder, Modbus and read values of a servo motor
Time to create page: 0.045 seconds