Hello!
I have a project with APAS KUKA robot, with KRC4 robot controller. The robot has Nexeed option package, to communicate with a Bosch Rexroth PLC. I want to send REAL variables to the PLC, but as you can see in the attached video, the variables are not working perfectly in the PLC.
I have REAL global variables in the config.dat files, that I write only, when some statement become true. Then I have to convert the real variables, to integer variables with the following conversion function.
GLOBAL DEFFCT INT REAL_TO_INT(INPUT_VALUE:IN)
DECL REAL INPUT_VALUE
DECL INT OUTPUT_VALUE
DECL CHAR real_to_out[32]
DECL INT B
DECL INT OFFSET
B=0
FOR B=1 TO 32
real_to_out[B]="0"
ENDFOR
OFFSET=0
CAST_TO(real_to_out[],OFFSET,INPUT_VALUE)
OFFSET=0
CAST_FROM(real_to_out[],OFFSET,OUTPUT_VALUE)
RETURN OUTPUT_VALUE
ENDFCT
Display More
After the conversion (that I do only when some statements become true), I store the values in global integer variables in the config.dat, and in the sps.sub I send out these integer variables to the output (output signal size is 32 bit long) every sps.sub cycle.
Do you have any idea what can cause the problem? The variables are not not written at any other place. In the KUKA Actual Variable display the variables are consistent, the values are good, and not "jumping" back to 0, as I can see in the PLC variable list.
Thanks very much for your help!
Gergő