Hi everyone!
First of all, thank you for this forum. It's the hope and a great help for every robot programmer.
I'm writing a driver for a Kawasaki RS013N with F60 controller. I'm using KIDE and I need to encode an integer into a string to send it over TCP/IP.
To do this, I am writing a program named .PROGRAM PackStatus(.@packet_size, ...), which takes as local variable an integer .@packet_size. This should be encoded into a string $packet_msg.
I understood that I need to use the function $ENCODE to do this, but this cannot take as input an integer. So, following this thread, I decided to use BITS to convert the integer and encode it. However, if I try to do the following
.PROGRAM PackStatus (.@packet_size)
; Fill the packet size
$packet_msg = $ENCODE (/I3, BITS(.@packet_size, 16))
.END
I get the syntax error "0012: Illegal variable type" for .@packet_size. And, this is not a problem with local variables, because if I do the following in my Main
I get the syntax error""0025: Illegal argument of function" for @packet_size.
Could you please help me understand where I am going wrong? What is the correct way to convert and integer into a string and encoding it. I would prefer to do it in a program using a local variable integer.
Thank you so much in advance.