Hello,
I am writing a PC program that checks the robot joint positions every scan and sends it over EtherCAT to my PLC over a 32bit address. My robot is BX200L-A001 and my controller is E02. This is the snippet of code I am using inside an infinite WHILE loop:
HERE #pose
DECOMPOSE joints[0] = #pose
@Temp = INT(joints[0]*1000) ; <--- This is giving me an error "(P0115) Illegal Function"
BITS32 101, 32 = @Temp
I am not using 16 bits to send the joint values since I want a precision of 3 decimals and also I have a 7th axis (positioner) that can have joint values in the thousands.
Upon browsing here, I found a thread that says that BIT32 can only accept INTEGER values due to possibly a bug. For this reason, I am trying to convert the the REAL values from the "joints" array into integer and then passing that integer value to the BITS32 command. I am getting the "Illegal Function" error on the marked line above. I am assuming that the return type of the INT() function is still a REAL and not an INTEGER. How do I convert a REAL value in the joints array to an integer that can be passed to the BITS32 command?