Hi,
I have a Little problem with the minus sign.
The actual postion works fine but the send position doesn't arrive well in the drive.
So, my code for the actual position is:
This works perfectly, when I control the axis manually below zero, this is correct.
But when I send with the following code to the drive, the position is the drive below zero is completely rubbish:
I allready tried conversion from REAL_TO_DWORD, but that wasn't a succes either.
Owyeah, the ROL is because there is a word swap, the drive is a Lenze.
Any ideas ?
Thanks,
Gerry
I have a Little problem with the minus sign.
The actual postion works fine but the send position doesn't arrive well in the drive.
So, my code for the actual position is:
Code:
#TEMP_VARS.REC_POS_DWORD := ROL(
IN := #PN_POS_ACT_D,
N := 16);
#TEMP_VARS.REC_POS_DINT := DWORD_TO_DINT(#TEMP_VARS.REC_POS_DWORD);
#STD.RESULT."GRAPH RET"."ACT POS" := DINT_TO_REAL(#TEMP_VARS.REC_POS_DINT) / 10.0;
This works perfectly, when I control the axis manually below zero, this is correct.
But when I send with the following code to the drive, the position is the drive below zero is completely rubbish:
Code:
#PN_POS_SET_D := ROL(
IN := DINT_TO_DWORD(ROUND(#STD.CMD."GRAPH CMD"."POS SET" * 10.0)),
N := 16);
I allready tried conversion from REAL_TO_DWORD, but that wasn't a succes either.
Owyeah, the ROL is because there is a word swap, the drive is a Lenze.
Any ideas ?
Thanks,
Gerry